BPG2JPG transparent service worker polyfill demo

Once the service worker attached to the page is loaded and installed, reload the page to have all BPG images automatically transcoded into JPEG (and cached) in the background by the service worker:

Test BPG image file

Note that on first reload it might take up to a second for the above image to appear (especially on slower systems & mobile). This is because the service worker has to fetch the image from the network, and convert it into JPG format.

On subsequent reloads you will notice that the image is loaded almost instantly - since the service worker will serve the already-cashed JPG file for the request.