4

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

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

You mean the Last-Modified header?
You can use a combination of different types of headers depending on what exactly your needs are. Response cache's aren't really my area of expertise but they should be easy enough to google.
2

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.