Closed jikyu closed 2 years ago
There's a related question on stack overflow: https://stackoverflow.com/questions/73221013/kotlin-asyncimage-coil-not-caching-images-properly-keeps-reloading-each-time
Oops I was using applicationContext.cacheDir
, should have used more permanent applicationContext.filesDir
Describe the bug My app loads images and caches them to DiskCache without any issues. Queries like
context.imageLoader.diskCache?.get(key)
andcontext.imageLoader.diskCache?.size
work fine after fetching images.However, every time I restart my app, disk cache gets reset. If I try to call
context.imageLoader.diskCache?.size
when the app loads, it returns 0. Is this expected behavior?To Reproduce
Create new image loader
Fetch images and load it into cache
At this point,
applicationContext.imageLoader.diskCache?.get(imageUrl)
works fine.On the next app restart, diskCache is reset. For example....
Version Coil 2.1.0