16

I found in iOS simulator, there is a file named Cache.db in Library caches path.

There are some tables in the db:

sqlite3 Cache.db 
SQLite version 3.7.5
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .table
cfurl_cache_blob_data       cfurl_cache_response      
cfurl_cache_receiver_data   cfurl_cache_schema_version

I want to know what does it do? And how can we make use of this db?

James Webster
  • 31,873
  • 11
  • 70
  • 114
qichunren
  • 4,405
  • 7
  • 37
  • 48

1 Answers1

21

That is used by NSURLCache. It is automatically used when you create a NSURLRequest unless you specify that you do not want to use cache.

rckoenes
  • 69,092
  • 8
  • 134
  • 166
  • 1
    To add to rckones point you do not need to do anything in particular to use this cache. I believe it caches specific URL requests so that if you requested host.com/webservice/1 and later requested the same exact string it would load almost instantly. – tacos_tacos_tacos Dec 28 '11 at 08:01
  • 4
    To disable request caching: http://stackoverflow.com/questions/405151/is-it-possible-to-prevent-an-nsurlrequest-from-caching-data-or-remove-cached-dat – Adam Waite Jun 05 '13 at 15:44
  • Is this file cleared when the app is closed or something? – atuljangra May 08 '17 at 02:14
  • @atuljangra No Cache.db file will not be cleared automatically. You need to code for that to happen. – Sharath Kumar Sep 14 '17 at 05:48