Reroute image to webp when supported

recipe-exchange
#1

Our image backends support on the fly conversion of images based on the extension. We switch from .jpg to .webp in the worker when the browser supports it greatly reducing image size for supported browsers.

3 Likes

#2

HI, Just a curious question. Thanks for the code.

What if we already have the WebP version of the image file on our server. Then we don’t need to convert the file at all no?

Can you help me with the code of it.

Thanks in advance. :slight_smile:

0 Likes

#3

Isn’t polish already served webp version in supported browsers?

0 Likes

#4

Yeah, it does. Polish removes the metadata of the image etc.

As I’m using the compressions services on my WordPress blog, and WordPress already has webP version of the images. If that is possible to do with the workers, just switch the image from JPG or PNG to webP via workers. That will be super fast.

0 Likes