Glide cache the final bitmap or will it continue to cache the original
image and apply the transformation to it every time the ImageView is
shown?
In Glide, caches the original, full-resolution image and additionally smaller versions of that image. For example, if you request an image with 1000x1000 pixels, and your ImageView is 500x500 pixels, Glide will put both versions of the image in the cache.
In Gide, we have different DiskCacheStrategy. Based on this available strategy, we can decide the caching of images.
DiskCacheStrategy.NONE -> caches nothing
DiskCacheStrategy.ALL -> caches all versions of the image
DiskCacheStrategy.DATA -> caches only the original full-resolution image.
DiskCacheStrategy.RESOURCE -> caches only the final image, after reducing the resolution (and possibly transformations)
DiskCacheStrategy.AUTOMATIC -> intelligently choose a cache strategy based on the resource (default behavior of Glide 4.x)
If you have an image that you know you'll manipulate often and make a bunch of different versions of it, it makes sense to only cache the original resolution. Thus, we'd tell Glide to only keep the original.
GlideApp
.with(context)
.load(yourUrl)
.diskCacheStrategy(DiskCacheStrategy.DATA)
.into(imageView);
For more info on this, please check Glide documentation