Generate WebP

If you enable Generate WebP in Media » Images, the Image Optimizer will generate WebP version for the images. WebP version will always located in the same folder as the original image, it will have the same filename, and a .webp extension will be added.

For example if the original image is /wp-content/uploads/2020-12/test.jpg the WebP version will be stored in /wp-content/uploads/2020-12/test.jpg.webp

Serve WebP

If there is a WebP version for an Images, Swift Performance provides 2 option to serve them to the visitor. Regarding that not all browsers has WebP support yet, we can’t simply replace images to WebP.

 

The <picture> method
Swift Performance will replace all <img> tag in the source to a <picture> tag, which contains the WebP image with the original image as a fallback. If you choose this method, it is also recommended to enable Serve WebP Background Images.

With <picture> method you can exclude any image from being served as WebP, Swift Performance will add images automatically, in that rare cases if WebP version is bigger than the original image.

 

Rewrites
If you choose rewrites method, Swift Performance will generate rewrite rules, so the server will serve the WebP version instead of the original image, if it is exists, and the browser supports WebP. However if you are using a reverse proxy, like Cloudflare it can cause issues, that because we suggest to use <picture> method for better compatibility.