Force.com-JavaScript-REST-Toolkit icon indicating copy to clipboard operation
Force.com-JavaScript-REST-Toolkit copied to clipboard

Add Cache-Control headers to requests in ForceTK

Open bhariharan opened this issue 12 years ago • 0 comments

As of iOS 5, HTTP responses received within a web view would be cached only in memory, and not in the filesystem. However, in iOS 6, response data is cached in the filesystem in plain text, at this location - '[Application]/Library/Cache/[application name]/Cache.db'. In order to prevent sensitive data from being cached, it would be a good idea to add this line to all outgoing requests that go through ForceTK.

xhr.setRequestHeader('Cache-Control', 'no-cache, no-store');

within the ajax call in

forcetk.Client.prototype.ajax = function(path, callback, error, method, payload, retry) {}

bhariharan avatar Feb 01 '13 23:02 bhariharan