PluginProbe
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript / 4.1.18
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript v4.1.18
4.1.19 4.1.18 4.1.17 4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.0.30 4.0.29 4.0.28 4.0.27 4.0.26 4.0.24 4.0.25 4.0.23 4.0.22 4.0.21 4.0.19 4.0.18 4.0.17 4.0.16 1.9.3 All 173 releases
← All changes | inc/cache/class-berqwarmup.php +15 -0 4.0.22 → 4.1.18 View file →
@@ -7,8 +7,10 @@
7 7
8 8 if (!class_exists('berqWarmup')) {
9 9 class berqWarmup
10 10 {
11 + public $cache_warmup_fired = false;
12 +
11 13 function __construct()
12 14 {
13 15
14 16 // Automatic cache warmup
@@ -41,8 +43,21 @@
41 43 {
42 44 if (!berqwp_can_use_cloud()) {
43 45 return;
44 46 }
47 +
48 + if ($this->cache_warmup_fired) {
49 + return;
50 + }
51 +
52 + // Debounce across separate requests (e.g. several plugin updates in a row)
53 + if (get_transient('berqwp_warmup_running')) {
54 + return;
55 + }
56 +
57 + set_transient('berqwp_warmup_running', true, 5 * MINUTE_IN_SECONDS);
58 +
59 + $this->cache_warmup_fired = true;
45 60
46 61 global $berq_log;
47 62 $berq_log->info("Warming cache using sitemap.");
48 63