Background fetch experiment

The image at the bottom of this page is served only after a delay of 4.5 seconds (seems that Glitch has a timeout of 5 seconds).

However, if you click on "Start download" the background fetch api will download the image and store it using the caches API. It will ask for permission to send notifications too, so that you can be notified when the download is complete.

Once the background fetch API has stored the image in the cache, it will be served by the service worker, so it will load immediately. You can empty the cache and try again with the "Empty cache" button.

Make sure you are using Chrome Canary or have the experimental web platform features flag turned on in Chrome's chrome://flags settings.