Reputation: 3858
I'm using Picasso to load images. Some images come from a URL, but sometimes that images change on the server, keeping the same name. So, does Picasso understand if the cached images are out of date, even if they have the same file name? Or it just checks if the file name is the same of the one in cache?
Thank you
Upvotes: 4
Views: 1890
Reputation: 41
Picasso generally loads images from the cache itself. So you have same image file that keeps changing then it would be ideal for you to use the below flags.
1 Change the memory policy
.memoryPolicy(MemoryPolicy.NO_CACHE)
This will skip Picasso's cache.
2 You can also change Network policy
.networkPolicy(NetworkPolicy.NO_CACHE)
if you need to bust the HTTP cache.
Hope it helps.
Upvotes: 2
Reputation: 20563
Picasso is a standards-compliant HTTP client library. It checks for HTTP response cache headers for cache validation. If your server is adding the proper headers to your resources then Picasso will handle cache invalidation like a champ.
Upvotes: 2