7

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?

user
  • 86,916
  • 18
  • 197
  • 190
reza
  • 197
  • 2
  • 14
  • Why do you write with "CamelCase" style? :) – Víctor Albertos Sep 09 '14 at 23:15
  • ah i keep being told about it :) – reza Sep 09 '14 at 23:17
  • Have you tried [it](http://stackoverflow.com/questions/22016382/invalidate-cache-in-picasso)? Picasso.with(ctx).load(new File("/path/to/image")).skipMemoryCache().into(imageView) – Víctor Albertos Sep 09 '14 at 23:19
  • yes, this skips memory cache just for once, after a refresh, and trying without the skipmemorycache again, it loads from cache again, it doesnt replace it – reza Sep 09 '14 at 23:22
  • You can't. But we're going to add it: https://github.com/square/picasso/issues/438 – Jake Wharton Sep 09 '14 at 23:36
  • Thanks for Your nice Lib Jake,Its Amazing how a genius like You lost this option ;) may i ask how long untill then? – reza Sep 09 '14 at 23:37
  • Please stop using camel case for your posts, @reza. Writing styles that are difficult to read cause other people work. Since you've admitted to having being told about it before, I'm downvoting. – halfer Sep 13 '14 at 00:58

2 Answers2

3

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

Community
  • 1
  • 1
AbdelHady
  • 9,334
  • 8
  • 56
  • 83
1

Answer from Jake Wharton.

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

halfer
  • 19,824
  • 17
  • 99
  • 186