webp-express
webp-express copied to clipboard
image/webp missing on default /etc/mime.types debian (8,9,10) setup
Hi,
As it's second time I get trapped wondering why webp-express isn't working on a new setup. And only after hunting for a while I remembered that I had been there before.
It just "brakes" the rewrite rule if apache doesn't have the mime type... But no error shows up. Those silent errors... what a pleasure.
Made me discover a nice page for testing webp-express: nice one !! But didn't help me on this one ;)
perhaps this info could be added somewhere?
Perhaps there is a better thing to do: adding something like this to the .htaccess template would avoid the trap for good
# lacking in /etc/mime.types of many distributions (debian)
# without it won't work
AddType image/webp .webp
I'm not sure wether AddType
should be wrapped in a <ifModule>
?
I have one last question: (just by curiosity)
RewriteRule ^/?(.+?)\.(jpe?g|png)$ /$1.$2.webp [NC,T=image/webp,E=EXISTING:1,E=ADDVARY:1,L]
ADDVARY does trigger something telling apache to add the Vary header (obviously without it header is removed) but I couldn't find documentation on this. So my question is, weather EXISTING variable was an other magic one or is it specific to webp-express to help "on the fly" conversion?
The ADDVARY
is read later in the generated .htaccess
, see https://github.com/rosell-dk/webp-express/blob/067549ab96c80a4137235d9126c11f6fbd8ab460/lib/classes/HTAccessRules.php#L884-L897