ios开发 如何让sdwebimage不缓存图片 每次都重新加载url?

 我来答
1150960838
2016-05-26 · 超过28用户采纳过TA的回答
知道答主
回答量:67
采纳率:0%
帮助的人:48.2万
展开全部
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletionBlock)completedBlock;
调用的时候设置下:
options = SDWebImageRefreshCached,该选项的含义如下:
/**

* Even if the image is cached, respect the HTTP response cache control, and refresh the image from remote location if needed.

* The disk caching will be handled by NSURLCache instead of SDWebImage leading to slight performance degradation.

* This option helps deal with images changing behind the same request URL, e.g. Facebook graph api profile pics.

* If a cached image is refreshed, the completion block is called once with the cached image and again with the final image.

*

* Use this flag only if you can't make your URLs static with embeded cache busting parameter.

*/
追问
对啊 我也是用这个 但是好像不行呢
追答
这个需要服务器配合的:setHeader("Cache-Control", "no-cache");要禁用缓存
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式