0

I know there're many similar questions in stackoverflow already, but they still don't clearly explain what I'm seeing.

I used

[NSData dataWithContentsOfURL:...] 

with NSURLCache setup and confirmed that it actually stores data in cache. (I opened up Cache.db in sqlite3 and checked the cfurl_cache_response table using "select * from cfurl_cache_response;")

It does create an entry right after dataWithContentsOfURL.

What's interesting is, even if it stored data in cache, it doesn't use it and make a network request which doesn't make sense.

I'm now thinking whether this is a bug in iOS. Does anyone have any insight on this issue? Should I report this to Apple?

Thank you.

Todd
  • 239
  • 2
  • 11
  • What was the URL? Maybe the server responded to not cache the resource. – cahn Feb 25 '14 at 01:17
  • If that was the case, it shouldn't have been stored in Cache.db. URLs with no-cache policy (or expiration date set to past) won't end up in Cache.db. – Todd Feb 28 '14 at 08:11

0 Answers0