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
Images in my server are organised into zipped groups for performance reasons.
I load them by passing two parameters, the URL of the zip file and the name of the file in that zip: imageView.load(MyData("https://mydomain.com/my_zip.zip", "my_image.jpeg"))
To allow that, I've implemented my custom fetcher that does the following:
Download zip file.
Extract the relevant file from the zip.
Return the image in that file.
This works fine. However, Coil will download the zip again if a second request targets the same zip file and a different image inside that zip.
To solve this, I'm thinking of modifyig the fetcher to cache the rest of images in the zip file but I'm not sure how to do this.
However, this won't solve the problem of two parallel requests to two different images targeting the same zip file. Ideally, I would like to block one of the requests until the other has downloaded and extracted the zip. Any idea how best to do this?
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.
-
Images in my server are organised into zipped groups for performance reasons.
I load them by passing two parameters, the URL of the zip file and the name of the file in that zip:
imageView.load(MyData("https://mydomain.com/my_zip.zip", "my_image.jpeg"))To allow that, I've implemented my custom fetcher that does the following:
This works fine. However, Coil will download the zip again if a second request targets the same zip file and a different image inside that zip.
To solve this, I'm thinking of modifyig the fetcher to cache the rest of images in the zip file but I'm not sure how to do this.
However, this won't solve the problem of two parallel requests to two different images targeting the same zip file. Ideally, I would like to block one of the requests until the other has downloaded and extracted the zip. Any idea how best to do this?
Beta Was this translation helpful? Give feedback.
All reactions