Skip to content

Commit

Permalink
v7.0-b28: * **Image Optimization** Supported latest firefox WebP Acce…
Browse files Browse the repository at this point in the history
…pt header change for serving WebP.
  • Loading branch information
Hai Zheng committed Dec 13, 2024
1 parent ada1499 commit ca5914b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions litespeed-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions src/htaccess.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = '';
}
Expand Down

0 comments on commit ca5914b

Please sign in to comment.