reza
reza

Reputation: 197

How to clear Picasso's cache for a specific url?

I'm trying to find out how can I clear cache of a specific URL or make Picasso notice for the server side's image change. Can someone help me with this?

Upvotes: 7

Views: 2444

Answers (2)

AbdelHady
AbdelHady

Reputation: 9702

Jake Wharton replied on Dec 12, 2014 that the best candidate solution to be in 2.5 milestone is:

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);

as answered by mes in this answer

Upvotes: 3

halfer
halfer

Reputation: 20430

Answer from Jake Wharton.

You can't [do this]. But we're going to add it: github.com/square/picasso/issues/438

Upvotes: 1

Related Questions