Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26534] Android: Modify native HTTP handling to only cache "GET" responses

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-11-08T23:00:13.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.5.0
ComponentsAndroid
Labelsandroid, cache, http
ReporterJoshua Quick
AssigneeJoshua Quick
Created2018-11-08T19:23:21.000+0000
Updated2018-11-09T17:30:40.000+0000

Description

*Summary:* Titanium's custom TiResponseCache.java class currently caches all HTTP responses and ignores the HTTP method. Meaning that it'll cache "POST", "PUT", "DELET", etc. which is a problem when using REST web APIs. It should be changed to only cache HTTP "GET" responses. _(Note: iOS does not cache "HEAD" responses.)_ *Note:* This is not an issue with Titanium's Ti.Network.HTTPClient on Android since it's currently set up to *never* cache responses. The only Titanium JavaScript API which does HTTP response caching is when you load images via URLs, which are "GET" requests. The above is only an issue for app's which do HTTP requests natively in Java, such as via a 3rd party native library.

Comments

  1. Joshua Quick 2018-11-08

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/10447 PR (7.5.x): https://github.com/appcelerator/titanium_mobile/pull/10448
  2. Lokesh Choudhary 2018-11-08

    FR Passed. Waiting for CR.
  3. Lokesh Choudhary 2018-11-08

    PR's Merged.
  4. Lokesh Choudhary 2018-11-09

    Verified the fix in SDK 7.5.0.v20181108182512. Closing.

JSON Source