I am using Glide image loader to load an image from a specific URL, now if I update the image to the same URL, Glide is still showing the cached image in my imageview. How to reload the image from the same URL?
Android – How to reload image in Glide from the same url
androidandroid-glideimage-loading
Related Topic
- Android – How to stop EditText from gaining focus at Activity startup in Android
- Android – How to open a URL in Android’s web browser from the application
- Android – Load image from url
- Android – How does one use glide to download an image into a bitmap
- Android – Remove image from cache in Glide library
- Android 8: Cleartext HTTP traffic not permitted
Best Answer
As per the
Glide
wikiCaching-and-Cache-Invalidation
Option 1 (Glide v4): Use
ObjectKey
to change the file's date modified time.Option 1 (Glide v3): Use
StringSignature
to change the file's date modified time.URLs - Although the best way to invalidate URLs is to make sure the server changes the URL and updates the client when the content at the URL changes, you can also use StringSignature to mix in arbitrary metadata
If all else fails and you can neither change your identifier nor keep track of any reasonable version metadata,
Option 2: You can also disable disk caching entirely using
diskCacheStrategy()
andDiskCacheStrategy.NONE
Reference: https://github.com/bumptech/glide/wiki/Caching-and-Cache-Invalidation