Hi there. I'm implementing a photo gallery with Je...
# android
a
Hi there. I'm implementing a photo gallery with Jetpack Compose. The URI obtained from ContentResolver is passed to AsyncImage of Coil library. It works. However, every time the app is restarted, the images are reloaded, which causes a slight time lag in the display. I think caching the small thumbnail images needed for display to disk will speed up loading, but Coil's disk cache only works with HTTP Fetcher. Do you have a good idea? Should I implement a disk cache myself?
r
I think you are seeing the delay because it takes some time for the content to be resolved. If you save the image thumbnails to disk, these thumbnails will also have Uris will need be resolved as well when the app loads, bringing you back to the same issue. This is primarily the reason why coils disk cache only works with HTTP Fetcher.
a
Thank you for your reply. I understand what you say. However, when comparing Google Photo and my app, the loading speed is the same immediately after clearing the cache, but Google Photo is faster in the second time. The attached videos show the second startup of both app. Google Photo shows all images immediately after startup. Why is Google Photo so fast?