What happens to SDWebImage Cached Images in my app when the image file on the server changes?

后端 未结 10 1221
夕颜
夕颜 2020-12-07 09:57

I am using the SDWebImage library to cache web images in my app:

https://github.com/rs/SDWebImage/blob/master/README.md

Current Usage:



        
10条回答
  •  轮回少年
    2020-12-07 10:20

    SDWebImage does aggressive caching by default. But now they give the option to respect your HTTP caching control headers and get the latest image.

    For this they have a new method where in options you can pass SDWebImageRefreshCached

    [imageView sd_setImageWithURL:[NSURL URLWithString:@"https://graph.facebook.com/xyz/picture"]
                 placeholderImage:[UIImage imageNamed:@"avatar-placeholder.png"]
                          options:SDWebImageRefreshCached];
    

    You can find the complete method details and explanation here.

提交回复
热议问题