lscache_wp icon indicating copy to clipboard operation
lscache_wp copied to clipboard

webp not working in Safari 14.0.1 (in versions macOS earlier Big Sur)

Open antomal opened this issue 4 years ago • 8 comments

I have macOS 10.14.6 & Safari 14.0.1 Installed plugin update 3.6

And … All the pictures are gone !!! Because webp in this version of the browser (14.0.1) is only supported in BigSur

Now what ?!

antomal avatar Dec 15 '20 17:12 antomal

Hi,

Could you please provide the full user agent header from your safari ?

Best regards,

qtwrk avatar Dec 15 '20 17:12 qtwrk

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Safari/605.1.15

antomal avatar Dec 15 '20 17:12 antomal

Hi,

please either revert to previous version , or use this htaccess rewrite rule as temp fix

RewriteCond %{HTTP_ACCEPT} "!image/webp"
RewriteRule ^(.*).(jpg|jpeg|png|gif).webp $1.$2 [L]

We will investigate this further and hopefully to find a reliable way to differentiate 10.14 and 11.0

Best regards,

qtwrk avatar Dec 15 '20 19:12 qtwrk

Reverted and fixed in https://github.com/litespeedtech/lscache_wp/compare/72edb33b6b3c...b2c7a3df75cd

FYI, my MacOS Catelina UA is User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15

hi-hai avatar Dec 15 '20 21:12 hi-hai

Will add a JS detection to make it. Ref from ruikai https://stackoverflow.com/questions/5573096/detecting-webp-support

Will be later versions as it needs to update vary.

hi-hai avatar Dec 18 '20 14:12 hi-hai

Cool! Thanks 👍

antomal avatar Dec 18 '20 16:12 antomal

Will add a JS detection to make it.

@hi-hai PHP detection won't be better? So the browser won't have to load another script. It is simple:

if( strpos( $_SERVER['HTTP_ACCEPT'], 'image/webp' ) !== false ) {
    // webp is supported!
}

rafaucau avatar Jan 11 '21 15:01 rafaucau

Will add a JS detection to make it.

PHP detection won't be better? So the browser won't have to load another script.

if( strpos( $_SERVER['HTTP_ACCEPT'], 'image/webp' ) !== false ) {
    // webp is supported!
}

Yeah , that's first thing we thought , but sadly no, Mac Safari doesn't put image/webp on accept header over main request.

qtwrk avatar Jan 11 '21 16:01 qtwrk