simple-cache icon indicating copy to clipboard operation
simple-cache copied to clipboard

WebP support

Open benoitchantre opened this issue 8 years ago • 3 comments

When .webp images exist, it would be nice to generate a specific cached file with src pointing to .webp images.

benoitchantre avatar Feb 25 '17 13:02 benoitchantre

Not sure I follow. Images aren't handled by Simple Cache.

tlovett1 avatar Feb 26 '17 07:02 tlovett1

The idea is not to handle images, but to generate and serve a cached file with src pointing to .webp images when they exist.

Cache Enabler does it, here's the description:

The plugin will check your upload directory for any JPG or PNG images that have an equivalent WebP file. If there is, the URI of these image will be cached in a WebP static file by Cache Enabler.

After reading some articles, I think this is not the best approach, because .webp images won't be used when the page can't be cached.

I did a test with the PageSpeed Module and Simple Cache. It worked well: the cached file was dynamically rewritten to serve .webp images generated by PageSpeed.

benoitchantre avatar Feb 27 '17 12:02 benoitchantre

My opinion is to leave such things for other systems, like Mod_Pagespeed, to handle.

Support for .webp is not that great across browsers (http://caniuse.com/webp/embed/), and while not particularly expansive support checking probably isn't an overhead the plugin should add for a small subset of browsers - especially since image handling isn't something the plugin does already.

Google's Mod_Pagespeed can handle the process of figuring out .webp support while it's checking other things and can process to .webp during its usual image optimization cycle should support be available. I would stick with Mod_Pagespeed for this if it's already there.

pattonwebz avatar Nov 03 '17 17:11 pattonwebz