Android-Universal-Image-Loader icon indicating copy to clipboard operation
Android-Universal-Image-Loader copied to clipboard

Respect Header Cache Age From URL

Open bassrock opened this issue 11 years ago • 2 comments

Things like Facebook Images have header cache ages. It would be cool if this library automatically handled it much like https://github.com/rs/SDWebImage does on iOS.

bassrock avatar May 07 '14 06:05 bassrock

This feature will be included into the library faster if you provide some additional info about concrete headers, their format, etc. Or create pull request with solution.

nostra13 avatar May 07 '14 21:05 nostra13

So basically iOS can be told to listen to the server's cache headers. So with Facebook Images there is a header that looks like this:

ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"

I am not sure how android handles this internally. But basically the basic functionality explanation is, if there is a cached image then use that and try to redownload the latest image in the background. This is useful for Facebook profile pictures as they are usually constantly changing.

bassrock avatar May 07 '14 21:05 bassrock