文件支持的 UIImageView 与 NSURL 缓存控制策略
我正在开发一款图像较多的 iPad 应用程序。我们实现了自己的表视图式控件,当用户滚动屏幕时,它会重用 UIImageViews。为了减少网络调用并使其性能更好,我实现了一个文件支持的 UIImageView,它将加载的图像写入 NSTemporaryDirectory 并在调用获取新图像之前进行检查。
我之前应该看看这个,但后来我被指出了不同的 NSURLRequest 缓存策略。
我的问题是,是否有任何原因使我的自定义文件缓存的性能比默认缓存更好?
I am working on an image heavy iPad app. We implemented our own table view-esque control which reuses UIImageViews as a user scrolls the screen. To reduce network calls and make it perform better, I implemented a file backed UIImageView that writes the loaded images to the NSTemporaryDirectory and checks that before making a call to get a new image.
I should have looked at this before but I was later pointed to the different NSURLRequest Cache Policies.
My question is, is there any reason my custom file cache could perform better than the default cache?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,iOS 缓存只是内存,因此您的自制缓存在应用程序启动时会更好地工作。
From what I gather the iOS cache is memory only, so your homebrew cache will work better across app starts.