文件支持的 UIImageView 与 NSURL 缓存控制策略

发布于 2024-09-15 23:33:15 字数 251 浏览 4 评论 0原文

我正在开发一款图像较多的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野味少女 2024-09-22 23:33:15

据我所知,iOS 缓存只是内存,因此您的自制缓存在应用程序启动时会更好地工作。

From what I gather the iOS cache is memory only, so your homebrew cache will work better across app starts.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文