[TIMOB-26534] Android: Modify native HTTP handling to only cache "GET" responses
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-11-08T23:00:13.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.5.0 |
Components | Android |
Labels | android, cache, http |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2018-11-08T19:23:21.000+0000 |
Updated | 2018-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.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/10447 PR (7.5.x): https://github.com/appcelerator/titanium_mobile/pull/10448
FR Passed. Waiting for CR.
PR's Merged.
Verified the fix in SDK 7.5.0.v20181108182512. Closing.