Search code examples
amazon-s3uikitnsurlrequesthttp-caching

NSURLCacheStorageNotAllowed still caching


I have a JSON file on S3 I'm downloading over HTTP with an NSURLConnection. I set the connection to use a caching policy of NSURLCacheStorageNotAllowed but I was still seeing an old version of the data come back. I changed to NSURLRequestReloadIgnoringLocalAndRemoteCacheData and the caching behaviour works.

Can anyone explain why?


Solution

  • This is a mistake by not understanding the difference between NSURLCachedStoragePolicy and NSURLRequestCachePolicy, please see my answer here:

    https://stackoverflow.com/a/24783824/1800915