Skip to content

Commit f747804

Browse files
author
Olivier Poitrey
committed
Add some words about SDWebImageRefreshCached in README
1 parent b1f1c08 commit f747804

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,19 @@ The following article gives a way to workaround this issue:
193193
[http://www.wrichards.com/blog/2011/11/sdwebimage-fixed-width-cell-images/](http://www.wrichards.com/blog/2011/11/sdwebimage-fixed-width-cell-images/)
194194

195195

196+
### Handle image refresh
197+
198+
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.
199+
200+
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:
201+
202+
``` objective-c
203+
[imageView setImageWithURL:[NSURL URLWithString:@"https://graph.facebook.com/olivier.poitrey/picture"]
204+
placeholderImage:[UIImage imageNamed:@"avatar-placeholder.png"]
205+
options:SDWebImageRefreshCached];
206+
```
207+
208+
196209
Installation
197210
------------
198211

0 commit comments

Comments
 (0)