MageAnts recommends the following customizations to fully support WebP in Magento 2:
- Add WebP MIME type in .htaccess or server config
- Use the <picture> tag with a JPG/PNG fallback in templates
- Create a helper to return the WebP path dynamically
- Override image rendering blocks or view models
- Enable lazy loading with loading="lazy"
- Auto convert images via cron jobs
- Integrate CDN for WebP delivery
- Include WebP generation in deployment scripts
- Update admin preview to support WebP