diff --git a/litespeed-cache.php b/litespeed-cache.php index 487b5cec8..0fc5ea2f2 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 7.0-b27 + * Version: 7.0-b28 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '7.0-b27'); +!defined('LSCWP_V') && define('LSCWP_V', '7.0-b28'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 3c077c888..4d9fa23f6 100644 --- a/readme.txt +++ b/readme.txt @@ -274,6 +274,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro * **CLI** QUIC.cloud CLI `wp litespeed-online ping` supports `--force` args now. * **Image Optimization** Dropped `Auto Pull Cron` setting. Added PHP const `LITESPEED_IMG_OPTM_ORI` support. * **Image Optimization** Supported `LITESPEED_IMG_OPTM_PULL_THREADS` to adjust the threads to avoid PHP max connection limits. +* **Image Optimization** Supported latest firefox WebP Accept header change for serving WebP. * **Purge** Allowed `LSWCP_EMPTYCACHE` defined to false to disable Purge all sites. * **Purge** Each purge action now has a hook. * **ESI** Fixed a log logic failure when ESI buffer is empty. diff --git a/src/htaccess.cls.php b/src/htaccess.cls.php index 2115edc5c..ea3efaaa9 100644 --- a/src/htaccess.cls.php +++ b/src/htaccess.cls.php @@ -592,9 +592,14 @@ private function _generate_rules($cfg) $new_rules[] = self::MARKER_WEBP . self::MARKER_START; $new_rules[] = 'RewriteCond %{HTTP_ACCEPT} "image/webp"'; $new_rules[] = 'RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]'; + $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]'; + + $new_rules[] = 'RewriteCond %{HTTP_USER_AGENT} Firefox/([0-9]+)'; + $new_rules[] = 'RewriteCond %1 >=65'; + $new_rules[] = 'RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]'; $new_rules[] = self::MARKER_WEBP . self::MARKER_END; $new_rules[] = ''; }