I'm writing a web app, where the user can download images for a later offline usage using the Cache API.
// when the user clicks the download button
window.caches.open("imageCache").then(function(cache) {
cache.add(imageUrls)
.then(() => console.log("image cached"))
.catch((e) => console.error(e));
});
This works as expected. Using the Chrome-Developer-Tools (under Application -> Cache Storage) I see the list of images:
Now, when I want to display the images in offline-mode using simple img
-Tags, it does not work for images that are served from a Google Cloud Bucket, but it does work with other image-sources.
Image from Google Cloud Buckets fails to load in offline mode:
Image from fakeimg.pl shows up in offline mode:
Any idea why it's not working?