Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们的 iOS 开发人员使用自定义缓存来处理 HTTP 图像请求。
但据我所知,HTTP 协议有它自己的缓存控制。但是我无法说服客户团队,他们说网络传输太多了。
那么,iOS http 层是否支持 HTTP 缓存头?
不,您不能直接依赖于图像,特别是如果您希望缓存在应用程序启动时持续存在等。您最好使用提供缓存选项和图像添加的网络框架:
AFNetworking 提供了方便的 UIImageView 添加(setImageURL:在 UIImageView 上,具有占位符支持等)。
MKNetworkKit