I am developing an android app.In that app, the server stores the images that is to be displayed in imageView of listview. I use picasso to get image from the server and display in imageview. Though I had uploaded new images in server, only old images are being displayed again. I suspect this is due to cache in picasso. I used 3 methods to prevent cache:
Picasso.with(getActivity()).load(data.get(pos).getFeed_thumb_image()).skipMemoryCache().into(image);
Picasso.with(getActivity()).load(data.get(pos).getFeed_thumb_image()).memoryPolicy(MemoryPolicy.NO_CACHE).into(image);
Picasso.with(context).invalidate(imagePath);
But in no result. How can I clear cache in picasso for particular url?
Try load url with variable like time now: Calendar urlvar = Calendar.getInstance(); int seconds = urlvar.get(Calendar.SECOND);
Then load your url by adding to string: ?urlvar so the final loaded url will be for example example.com/m.png?date it will be cashed but next load the date is changed so the url will change so will not load from cash. Hope ot work