How to test/check use of NSURLCache?

我与影子孤独终老i 提交于 2019-12-22 20:43:22

问题


I have added the two lines of code to my project as described in this blog post.

However, as nothing different happens in the app itself, is there a way to test this behaviour and check it is working as expected? Is there a profile in instruments? Is there something I can print to the log in Xcode when a response is cached/cached response is used?

It just seems so simple to implement, I want to make sure it is actually having an effect on my app and that I won't have to implement a caching system myself.

Many thanks,

Sam


回答1:


go offline right after you got the page and then reload the web view. the caching should take effect and the page should load I'd think




回答2:


You can make sure so by analyzing HTTP traffic through a third party software like Charles.

Whenever app will make a request, HTTP Analyzer will pick the request made. If it is using cache, then same will be reflected in it.
(Check the contents of response to confirm the same)



来源:https://stackoverflow.com/questions/17629214/how-to-test-check-use-of-nsurlcache

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!