I am using Glide to fetch and display photos from Firebase Storage. Things work very well when the device is in online.
When the user updates profile picture (firebase storage reference changes), Glide fails to fetch photo from Firebase storage's offline cache.
I don't want to cache photo using Glide. I just want to retrieve the cached photo from Firebase storage's offline cache
. Is there any possible way or workaround to solve this problem.
Here is my code.
Glide Module
@GlideModule
class MyGlideModule : AppGlideModule() {
override fun registerComponents(context: Context, glide: Glide, registry: Registry) {
registry.append(StorageReference::class.java, InputStream::class.java,
FirebaseImageLoader.Factory())
}
}
Code to fetch profile picture from firebase storage
GlideApp.with(profileIcon.context)
.load(customerPictureReference)
.centerCrop()
.placeholder(R.drawable.ic_profile_placeholder)
.into(profileIcon)