简体   繁体   English

iPhone上是否有可用的磁盘缓存?

[英]Is there on-disk cache available on iPhone?

I found a project to improve the cache strategy on iPhone. 我发现了一个改进iPhone缓存策略的项目。 Cos they are sure: " On iPhone OS, Apple did remove on-disk cache support for unknown reason " 他们确信:“ 在iPhone OS上,Apple确实删除了磁盘缓存支持,原因不明

But, I do not think so, see deitail: https://github.com/rs/SDURLCache/issues/39 但是,我不这么认为,请参阅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: 我发现在UIWebView应用程序的文件夹“Library / Catches / com.company.appname /”上有两个db文件:

ApplicationCache.db, Cache.db ApplicationCache.db,Cache.db

and try those sqls 并尝试那些sqls

"select * from CacheResourceData", after opening ApplicationCache.db 打开ApplicationCache.db后,“从CacheResourceData中选择*”

"select * from cfurl_cache_receiver_data" on Cache.db 在Cache.db上“select * from cfurl_cache_receiver_data”

Both are cache file content on the disk 两者都是磁盘上的缓存文件内容

So now I am confused, Who can tell me the truth and the evidence? 所以现在我很困惑,谁可以告诉我真相和证据?

从iOS 5.0开始, NSURLCache使用磁盘缓存: httpNSURLCache

ApplicationCache.db is used to cache HTML5 cache, and Cache.db is used with NSURLCache. ApplicationCache.db用于缓存HTML5缓存, Cache.db用于NSURLCache。

[[NSURLCache sharedURLCache] removeAllCachedResponses]; 

sets Cache.db empty. Cache.db设置空。 (Browse and see from Finder while using iOS simulator) (使用iOS模拟器时从Finder浏览和查看)

If you delete ApplicationCache.db from your directory HTML5 cache gets lost. 如果从目录中删除ApplicationCache.db,则HTML5缓存会丢失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM