Skip to content

Commit c99c168

Browse files
author
Hai Zheng
committed
v7.4-b18: * 🐞**CDN** Fixed a QUIC.cloud sync conf failure on network child sites.
1 parent 717f2e0 commit c99c168

2 files changed

Lines changed: 9 additions & 27 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-b17
6+
* Version: 7.4-b18
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-b17' );
38+
! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '7.4-b18' );
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

src/cdn/quic.cls.php

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* @since 2.4.1
66
* @package LiteSpeed
77
* @subpackage LiteSpeed/src/cdn
8-
* @author LiteSpeed Technologies <info@litespeedtech.com>
98
*/
109

1110
namespace LiteSpeed\CDN;
@@ -26,31 +25,13 @@ class Quic extends Base {
2625
const LOG_TAG = '☁️';
2726
const TYPE_REG = 'reg';
2827

29-
/**
30-
* Summary data for CDN configuration.
31-
*
32-
* @var array
33-
*/
34-
protected $summary;
35-
3628
/**
3729
* Force sync flag.
3830
*
3931
* @var bool
4032
*/
4133
private $force = false;
4234

43-
/**
44-
* Quic constructor.
45-
*
46-
* Initializes the summary data.
47-
*
48-
* @since 2.4.1
49-
*/
50-
public function __construct() {
51-
$this->summary = self::get_summary();
52-
}
53-
5435
/**
5536
* Notify CDN new config updated
5637
*
@@ -62,14 +43,15 @@ public function __construct() {
6243
* @return bool|void
6344
*/
6445
public function try_sync_conf( $force = false ) {
46+
$cloud_summary = Cloud::get_summary();
6547
if ($force) {
6648
$this->force = $force;
6749
}
6850

6951
if (!$this->conf(self::O_CDN_QUIC)) {
70-
if (!empty($this->summary['conf_md5'])) {
52+
if (!empty($cloud_summary['conf_md5'])) {
7153
self::debug('❌ No QC CDN, clear conf md5!');
72-
self::save_summary(array( 'conf_md5' => '' ));
54+
Cloud::save_summary(array( 'conf_md5' => '' ));
7355
}
7456
return false;
7557
}
@@ -122,19 +104,19 @@ public function try_sync_conf( $force = false ) {
122104
}
123105

124106
$conf_md5 = md5(wp_json_encode($options_for_md5));
125-
if (!empty($this->summary['conf_md5'])) {
126-
if ($conf_md5 === $this->summary['conf_md5']) {
107+
if (!empty($cloud_summary['conf_md5'])) {
108+
if ($conf_md5 === $cloud_summary['conf_md5']) {
127109
if (!$this->force) {
128110
self::debug('Bypass sync conf to QC due to same md5', $conf_md5);
129111
return;
130112
}
131113
self::debug('!!!Force sync conf even same md5');
132114
} else {
133-
self::debug('[conf_md5] ' . $conf_md5 . ' [existing_conf_md5] ' . $this->summary['conf_md5']);
115+
self::debug('[conf_md5] ' . $conf_md5 . ' [existing_conf_md5] ' . $cloud_summary['conf_md5']);
134116
}
135117
}
136118

137-
self::save_summary(array( 'conf_md5' => $conf_md5 ));
119+
Cloud::save_summary(array( 'conf_md5' => $conf_md5 ));
138120
self::debug('sync conf to QC');
139121

140122
Cloud::post(Cloud::SVC_D_SYNC_CONF, $options_for_md5);

0 commit comments

Comments
 (0)