Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add some words about SDWebImageRefreshCached in README

  • Loading branch information...
commit f74780484330c3f41893185112d2cd915521fc07 1 parent b1f1c08
@rs authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 README.md
View
13 README.md
@@ -193,6 +193,19 @@ The following article gives a way to workaround this issue:
[http://www.wrichards.com/blog/2011/11/sdwebimage-fixed-width-cell-images/](http://www.wrichards.com/blog/2011/11/sdwebimage-fixed-width-cell-images/)
+### Handle image refresh
+
+SDWebImage does very aggressive caching by default. It ignores all kind of caching control header returned by the HTTP server and cache the returned images with no time restriction. It implies your images URLs are static URLs pointing to images that never change. If the pointed image happen to change, some parts of the URL should change accordingly.
+
+If you don't control the image server you're using, you may not be able to change the URL when its content is updated. This is the case for Facebook avatar URLs for instance. In such case, you may use the `SDWebImageRefreshCached` flag. This will slightly degrade the performance but will respect the HTTP caching control headers:
+
+``` objective-c
+[imageView setImageWithURL:[NSURL URLWithString:@"https://graph.facebook.com/olivier.poitrey/picture"]
+ placeholderImage:[UIImage imageNamed:@"avatar-placeholder.png"]
+ options:SDWebImageRefreshCached];
+```
+
+
Installation
------------
Please sign in to comment.
Something went wrong with that request. Please try again.