4 ms·
For other platforms it should check to see if it's more efficient to serve a JPEGXL WASM polyfill
by charcircuit 3y ago
For other platforms it should check to see if it's more efficient to serve a JPEGXL WASM polyfill
- Scaevolus 3y agoWriting a good polyfill for this is harder than you might think, because the browser by default does lazy decoding of JPEG images to avoid holding too many buffers in RAM. Naive attempts (niutech/jxl.js) at JXL polyfills tend to crash browser tabs by using too much memory if they contain a few dozen megapixels of images, while Chrome normally can handle hundreds of megapixels of JPEGs on a page without difficulty.
- youngtaff 3y agoRelying on a polyfill means the browsers preloader won’t fetch the image early Can add an explicit preload hint but it’s additional complexity