Skip to content

Commit 734395f

Browse files
author
Hai Zheng
committed
v7.4-b12: * **Cache** Used WordPress Cache-Control value when the page is not cacheable. (asafm7)
1 parent 86bcfd9 commit 734395f

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

litespeed-cache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: LiteSpeed Cache
44
* Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
55
* Description: High-performance page caching and site optimization from LiteSpeed
6-
* Version: 7.4-b11
6+
* Version: 7.4-b12
77
* Author: LiteSpeed Technologies
88
* Author URI: https://www.litespeedtech.com
99
* License: GPLv3
@@ -35,7 +35,7 @@
3535
return;
3636
}
3737

38-
! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '7.4-b11' );
38+
! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '7.4-b12' );
3939

4040
! defined( 'LSCWP_CONTENT_DIR' ) && define( 'LSCWP_CONTENT_DIR', WP_CONTENT_DIR );
4141
! defined( 'LSCWP_DIR' ) && define( 'LSCWP_DIR', __DIR__ . '/' ); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro
261261
* 🌱**Toolbox** Disable All for 24 Hours. (PR#886)
262262
* **Cache** Better match iPhone browsers for mobile cache detection.
263263
* **Cache** Dropped `advanced-cache.php` since WP version v5.3+ required.
264+
* **Cache** Used WordPress `Cache-Control` value when the page is not cacheable. (asafm7)
264265
* **Page Optimize** Better compatibility for dummy CSS removal in case other plugins manipulated the quotes.
265266
* **Page Optimize** Dropped v4.2 legacy `LITESPEED_BYPASS_OPTM`.
266267
* **Crawler** Used .html file to test port in case some security plugins blocked .txt which caused port test failure. (#661828)

src/core.cls.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,11 @@ public function send_headers( $is_forced = false ) {
597597
// Send Control header
598598
if ( defined( 'LITESPEED_ON' ) && $control_header ) {
599599
$this->http_header( $control_header );
600-
if ( ! Control::is_cacheable() ) {
601-
$this->http_header( 'Cache-Control: no-cache, no-store, must-revalidate, max-age=0' ); // @ref: https://wordpress.org/support/topic/apply_filterslitespeed_control_cacheable-returns-false-for-cacheable/
600+
if ( ! Control::is_cacheable() && !is_admin() ) {
601+
$ori_wp_header = wp_get_nocache_headers();
602+
if ( isset( $ori_wp_header['Cache-Control'] ) ) {
603+
$this->http_header( 'Cache-Control: ' . $ori_wp_header['Cache-Control'] ); // @ref: https://github.com/litespeedtech/lscache_wp/issues/889
604+
}
602605
}
603606
if ( defined( 'LSCWP_LOG' ) ) {
604607
$this->comment( $control_header );

0 commit comments

Comments
 (0)