4

I found a project to improve the cache strategy on iPhone. Cos they are sure: "On iPhone OS, Apple did remove on-disk cache support for unknown reason"

But, I do not think so, see deitail: https://github.com/rs/SDURLCache/issues/39

I found there are two db files on folder"Library/Catches/com.company.appname/" with UIWebView app:

ApplicationCache.db, Cache.db

and try those sqls

"select * from CacheResourceData", after opening ApplicationCache.db

"select * from cfurl_cache_receiver_data" on Cache.db

Both are cache file content on the disk

So now I am confused, Who can tell me the truth and the evidence?

meadlai
  • 895
  • 1
  • 9
  • 22

2 Answers2

2

As of iOS 5.0 NSURLCache uses on-disk cache: http://petersteinberger.com/blog/2012/nsurlcache-uses-a-disk-cache-as-of-ios5/

Fabian Kreiser
  • 8,307
  • 1
  • 34
  • 60
1

ApplicationCache.db is used to cache HTML5 cache, and Cache.db is used with NSURLCache.

[[NSURLCache sharedURLCache] removeAllCachedResponses]; 

sets Cache.db empty. (Browse and see from Finder while using iOS simulator)

If you delete ApplicationCache.db from your directory HTML5 cache gets lost.

Sukitha Udugamasooriya
  • 2,268
  • 1
  • 35
  • 56