Webp ios14 support




Wordpress LScache Plugin: Webp ios14 support

Last Updated on: Wed, 15 Apr 2026 00:00:02
Would it possible to add support to use the webp picture if the browser/agent is iOS 14 safari and up? Like my agent is. Mozilla/5.0 (iPhone CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1 Thank you Hi, OK, could you please test this out ? 1. disable webp replacement in your setting 2. edit file /litespeed-cache/src/htaccess.cls.php , in line 609 , after $new_rules[] = RewriteRule . - [E=Cache-Control:vary=% ENV:LSCACHE_VARY_VALUE +webp] , add `$new_rules[] = RewriteCond % HTTP_USER_AGENT iPhone. Version/( d) 2 . Safari $new_rules[] = RewriteCond %1 >13 $new_rules[] = RewriteRule . ? [E=Cache-Control:vary=% ENV:LSCACHE_VARY_VALUE +webp] ` 3. edit file /litespeed-cache/src/media.cls.php , in line 414 , before return false , add $version = preg_match( /OS (( d+_?) 2,3 )/i , $_SERVER[HTTP_USER_AGENT], $matches) $version = str_replace( _ , . ,$matches[1]) $version = substr($version, 0, strpos($version, . )) if ($version >= 14) return true 4. now enable back webp replacement , see how it goes Best regards, @CacheCrawler Thank you, its worked partly. For IOS 14 it showed the webp picture but for a older phone with agent: Mozilla/5.0 (iPhone CPU iPhone OS 12_4_8 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1 it didnt show any picture only empty box, so I guess its trying to show the webp picture wrongly instead of jpg. Also if I purge all cache and first enter with the old IOS 12.4.8 and then enter with the phone with IOS 14 it shows the jpg version instead of webp for both phones. Note: used the Image WebP Replacement setting to disable and ` was replaced as Hi, Yes, sorry , I made mistake in rewrite rule please change this line $new_rules[] = RewriteCond % HTTP_USER_AGENT iPhone. Version/( d) 2 . Safari to $new_rules[] = RewriteCond % HTTP_USER_AGENT iPhone. Version/( d 2 ). Safari then repeat the same process and check again. please note , this wont work with QUIC cloud , if you have that , please disable it during test. Best regards, @CacheCrawler I am not using QUIC cloud CDN, thanks it worked fine for me, could this be added to next release? Hi, the new rules work ? yeah , if everything works as it can correct detect/differentiate iOS 14 and older version , it would be added in future release. Best regards, @CacheCrawler yes the new rule worked for me. thanks



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference