You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question regarding loading images with Coil.
In my current project, the flow is Activity A → Activity B. Inside Activity B, a Composable loads an image from a URL using Coil. The issue is that even when navigating back and forth between A and B, previously loaded images do not seem to be retrieved from memory cache, and the image appears slightly slower than when using a native view.
Based on the logs, Coil is loading the image from disk cache in this scenario.
However, if I load the same image in Activity A first and then navigate to Activity B, the image appears instantly, and the logs show that it is being loaded from memory cache.
So my question is:
When an Activity is destroyed, does Coil clear or lose the memory cache associated with the images loaded in that Activity?
Currently, each Activity loads images using ImageRequest.Builder(LocalContext.current).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a question regarding loading images with Coil.
In my current project, the flow is Activity A → Activity B. Inside Activity B, a Composable loads an image from a URL using Coil. The issue is that even when navigating back and forth between A and B, previously loaded images do not seem to be retrieved from memory cache, and the image appears slightly slower than when using a native view.
Based on the logs, Coil is loading the image from disk cache in this scenario.
However, if I load the same image in Activity A first and then navigate to Activity B, the image appears instantly, and the logs show that it is being loaded from memory cache.
So my question is:
When an Activity is destroyed, does Coil clear or lose the memory cache associated with the images loaded in that Activity?
Currently, each Activity loads images using ImageRequest.Builder(LocalContext.current).
Beta Was this translation helpful? Give feedback.
All reactions