WebP replacement not optimal
-
LiteSpeed Cache is generating physical WebP files (image.jpg.webp) and WordPress is outputting them in
srcset, but the<img src>remains the original JPG.Is there a supported way (filter, setting, or hook) to make WebP the primary source for browsers that support it — e.g. via
<picture>output or WebP-firstsrc— particularly for LCP images, without relying on Accept-header negotiation?Here is an example:
<img fetchpriority=”high” decoding=”async” width=”481″ height=”386″
src=”https://hatsfromoz-uk.b-cdn.net/wp-content/uploads/2021/04/SpringSummer1.jpg”
srcset=”https://hatsfromoz-uk.b-cdn.net/wp-content/uploads/2021/04/SpringSummer1-200×160.jpg.webp 200w, https://hatsfromoz-uk.b-cdn.net/wp-content/uploads/2021/04/SpringSummer1-400×321.jpg.webp 400w, https://hatsfromoz-uk.b-cdn.net/wp-content/uploads/2021/04/SpringSummer1.jpg.webp 481w”
sizes=”(max-width: 640px) 100vw, 481px”
alt=”Spring Racing Fascinators in UK – Hats From OZ”
class=”img-responsive wp-image-106024″
title=”Hats and Fascinators Online – Elegant UK Millinery | Hats From OZ – Hats From OZ UK”>
You must be logged in to reply to this topic.