Why are my images not being converted to WEBP format?
The 20i Web Optimisations allow you to quickly and easily optimise resources on your website to provide a better user experience and to reduce your website's loading time. One of the most popular filters is the Convert to WEBP lossless filter which converts PNG and non-animated GIF images to losslessly-encoded WebP. This happens if it's determined that the images are sensitive to compression noise and if the latter format is supported by the browser, otherwise, this filter is ignored.
How to check if images are being converted
You can check if an image is being converted to WEBP by checking it's response headers. An easy way to do this for a particular image is to right-click and select Open image in new tab. You should then immediately see if the image is appended with the .webp file format. If not, you can check the response headers by selecting F12 and then choosing the Network tab (in Chrome), then select the first row under the Name heading and choose the Headers tab. Look for the following two headers:
These tell you if the web optimisations are enabled, and also which indivial filters are in use. In this case, we're looking for the convert_to_webp_lossless filter which we can see is enabled in the above example.
Why are my images not being converted?
The web optimisations make a determination whether there's enough benefit to converting the resource to the WEBP format. If resources aren't being optimised then it's possible they're not in a 'cacheable' state. If the web optimisations sees cache-control headers such as nocache or private it will not rewrite the resources. The module will attempt to rewrite and optimise as many resources as possible but sometimes it may not be able to rewrite all resources because some - particularly those served by third-party themes or plugins - may require a more aggressive filter or optimisation technique to ensure they're rewritten. While we can help with ensuring the module is working from the outset, we can't help with those manual granular optimisations that require base code level changes.
It's worth noting, the web optimisations will adapt to any Content Security Policies specified in the response headers, usually set in a .htaccess file. So reviewing any rules set there is important.