my app displays some images from the web. I need ...
# android
k
my app displays some images from the web. I need the app to have them downloaded so they can be displayed offline. I am already using Coil, how should I handle it? 1. Use Coil's backing OkHttp disk cache with no size limit and roll my own eviction policy 2. Use some other library (?) that handles this 3. Implement my own downloads (download images to a specific folder, handle all the records, eviction) 4. ???
4️⃣ 1
3️⃣ 1
2️⃣ 1
1️⃣ 4
u
Usually the image loading libraries like Glide provide image cache on the fly So if you use glide and pass the url when you are online so it stores that image in cache and next time when you hit the url it will show it from cache no matter you are online or offline. Sometimes when the image get changed on server but the url remain same so it gets loaded from cache and I faced this sometimes. You need to use disk cache strategy as per your requirement in Glide