Question

I'm writing a Cordova app, which is configured to use a NSURLCache.

For security reasons, I'd like to prevent certain requests and responses from being written to disk. How can I do this? (My concern is not about reusing cached data in subsequent requests; I don't want the data to be written to disk at all.)

Does iOS respect the Cache-Control: no-store header, in requests and/or responses? Since this is a browser application, I can't use any Objective C code when making individual requests.

Was it helpful?

Solution

Does iOS respect the Cache-Control: no-store header?

Yes.

If using a third party, you'll need to make sure that you're not using any third party libraries that ignore this header, though. For example, SDWebImage has its own caching rules, while AFNetworking just uses NSURLCache.

Some more helpful details are here: http://nshipster.com/nsurlcache/ (the Apple documentation on this class is lacking.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top