Force.com-JavaScript-REST-Toolkit
Force.com-JavaScript-REST-Toolkit copied to clipboard
Add Cache-Control headers to requests in ForceTK
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) {}