Generate and serve WebP or AVIF in Magento: two separate jobs
Why does Magento still serve JPEG after creating a WebP file?
Creating the WebP or AVIF derivative and choosing it in the storefront are separate steps. Check the product’s actual image request and response to see which format Luma serves, then inspect the fallback.
Try it on staging: Use one image on a staging product and test with cache both cold and warm. Compare visual quality and bytes for the rendered size before rolling out to the catalogue.
Generating an image and serving it are separate jobs
To use WebP or AVIF on a Magento store, create suitable files and make the storefront actually deliver them with an appropriate fallback. Image Optimisation generates alternate files. Its documented product-image hook returns the original Magento image URL; the buyer package does not automatically select generated siblings in Luma HTML or GraphQL. Theme or delivery-layer integration remains a separate part of the job.
Start by checking rendered dimensions, Magento's resized cache images and any image service already provided by your CDN. If those services already generate and serve the right formats, another converter may add little. Magento's catalog:images:resize rebuilds resized renditions; it is a separate operation from this module's format generation.
What the current package is for
The current public version is 1.0.4. The guide describes WebP and optional AVIF siblings from supported source images, using the available Imagick or GD codec support. AVIF is off by default. The offer lists Magento Open Source 2.4.9 and Luma compatibility. The guide records standalone Admin and PNG-to-WebP checks for 1.0.3 on PHP 8.5.10; that is dated evidence, not a new test of your 1.0.4 host or every encoder.
Choose when generation should happen
For an existing catalogue, the documented scan registers catalogue gallery images as pending. A pending-only optimisation run can process a bounded batch, and working Magento cron can process pending records. Use the command reference to distinguish that route from a full optimisation walk, which covers supported files across the media directory and is not limited by the pending batch option.
Page-load mode generates a missing sibling synchronously while resolving an image URL, so that conversion can add work to a shopper's request. Cron or CLI generation lets you schedule that work separately. Existing siblings are normally skipped: changing a quality setting does not itself replace already generated files. Plan a controlled regeneration rather than assuming a setting change has changed the output.
Why the browser still requests the original
If a WebP file exists but the page still transfers JPEG, inspect the rendered image markup, selected source and network response. The generated sibling has not necessarily been connected to delivery. Have the theme or image-service maintainer define source selection, browser fallback and cache behaviour. Avoid rewriting file extensions blindly: an alternate may be missing, unsuitable or differently cached.
A controlled quality and delivery check
Illustrative acceptance exercise, not a performed benchmark: choose a transparent product image and a detailed photograph. Preserve the originals, generate alternates on staging and compare text legibility, colour, transparency and file sizes at the intended display dimensions. A generated file can be larger than its source; do not report savings until measured.
- Record original dimensions and bytes, output format, quality setting and actual generated bytes.
- Enable the reviewed delivery integration for the sample only.
- Check which resource a browser selects and its transferred bytes, content type and cache response. Test the fallback path too.
- Inspect the same product and category layouts on a narrow screen.
- Measure repeated comparable page loads before and after. Keep slow runs and distinguish a lab result from real-user Core Web Vitals.
Upload resizing and lazy loading need their own review
The optional upload hook can downscale new JPEG/PNG uploads and changes the saved upload; retain a source copy. The optional HTML lazy-loading hook skips a configured number of initial images and selected classes. It does not identify the actual visual LCP image. Do not lazy-load a critical above-the-fold product image merely because a generic rule selects it. Headless storefronts need their own implementation.
Read the Image Optimisation product, its generation and integration guide and web.dev's image-performance explanation. If the broader page remains slow, investigate the actual LCP, INP and CLS causes. No format conversion guarantees a fixed page-speed gain.
Product information reviewed 4 November 2026 by AgenticEcom. Illustrative examples are not customer results or new runtime tests.
