How to clear the cache of a specific URL from the Picasso cache

Picasso is a nice library, but for a long time Im trying to find how I can clear the cache of a specific URL or make Picasso a notification to change the image on the server side. Can someone help me. How can i understand that.

+4
source share
2 answers

From Jake Wharton.

You cannot [do it]. But we will add it: github.com/square/picasso/issues/438

+1
source

Jake Wharton replied on December 12, 2014 that the best decision for the candidate should be 2.5 steps:

picasso.load('http://example.com/')
  .cachePolicy(NO_CACHE, NO_STORE)
  .networkPolicy(NO_CACHE, NO_STORE, OFFLINE)
  .into(imageView);

enum MemoryPolicy {
  NO_CACHE, NO_STORE
}
enum NetworkPolicy {
  NO_CACHE, NO_STORE, OFFLINE
}

Update

or now you can use:

Picasso.with(getActivity()).invalidate(file);

mes

+1

All Articles