keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

Firefox 666 #52

Closed rosell-dk closed 4 years ago

rosell-dk commented 5 years ago

It was indeed good news when Firefox added webp support in Firefox 65. And this works fine with Cache Enabler, as Firefox 65 adds "image/webp" to the Accept request header, both when making image requests, and for the document.

However, Firefox 66.0 has changed the behavior. It still adds "image/webp" to image requests, but no longer adds it for documents. This means that Cache Enabler fails to serve webp files to Firefox 66.

Do you have any idea on how to overcome this?

I have thought about inspecting the User-Agent header, looking for Firefox/66 and above. However, it is possible for users to disable webp support in Firefox. That setting will probably only be used by very few people, but still.

Perhaps you could let the user decide. That is, add an option if Cache Enabler should serve the webp version to Firefox 66 and above.

svenba commented 4 years ago

There isn't much we can do about this at the moment. An alternative could be the Image Processing service by KeyCDN as it doesn't have this limitation: https://www.keycdn.com/support/image-processing

coreykn commented 4 years ago

Firefox 65 introduced support for WebP formatted images by adding image/webp to the HTTP Accept request header on both HTML pages and images. Firefox 66 removed this from the HTML pages because it did not align with the fetch specification.

The fetch specification has not changed but since Chrome is sending this on HTML pages and a lot of websites use this to detect WebP support Firefox 72 has added image/webp again to the default Accept header on HTML pages.

This means the issue is no longer occurring and the Cache Enabler plugin is able to serve WebP formatted images to Firefox browsers.

Resources: