4

I’m making an android application that have an user with a profile image. The obstacle is that when the image is changed on the server side the image’s link remains the same and my app shows an old one.

I asked server developer about it and he said that I can use eTag that changes with an image.

But the main obstacle remain that neither picasso or glide provide methods to work with eTags.

I mean a user’s avatar link remains always the same even if it’s content is changed: http://somehost/users/2/avatar.png

How could I deal with it less painfully? Which frameworks should I use or I’ve to implement this logic manually?

  • [meh?](https://developers.google.com/picasa-web/docs/2.0/developers_guide_protocol#RetrievingCached) – DaSourcerer May 18 '16 at 16:27
  • can you make this more clear : "The obstacle is that when the image is changed on the server side the image’s link remains the same and my app shows an old one." – pouyan May 18 '16 at 16:28
  • if you replace your old image with new one so what is problem ? – pouyan May 18 '16 at 17:06
  • @pooyan I think he is having issues with caches not revalidating the image and thus serving stale content. – DaSourcerer May 18 '16 at 17:20
  • if @DaSourcerer be right, then there is 2 approach for this situation. first one is that in client after a special period, client send request to server and find out if data has been changed( not good way). second way is that when data has been changed in server, server should send data to special client or broad cast it (depend on usage). – pouyan May 18 '16 at 17:23
  • @pooyan there is some sort of middleground: [conditional requests](https://tools.ietf.org/html/rfc7232). That's where `ETag` and `If-None-Match` come into play. – DaSourcerer May 18 '16 at 17:37
  • Did you find a solution to your question? I am wondering the same right now... – IgorGanapolsky Jan 24 '18 at 19:43

0 Answers0