PluginProbe
xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN / 1.4.2
xSpeed Cache: AI-Powered Performance Hub with MCP, Caching & CDN v1.4.2
1.4.2 1.4.1 1.4.0 1.3.7 1.3.6 1.3.5 1.3.4 1.3.3 1.3.2 1.3.1 1.3.0 1.2.4 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 All 36 releases
← All changes | includes/class-purge-runner.php +19 -2 1.4.0 → 1.4.2 View file →
@@ -320,9 +320,9 @@
320 320 * through `xspeed_after_purge_all`, whatever modules clear alongside
321 321 * them.
322 322 *
323 323 * @param string $cause Who asked.
324 - * @return array{entries:int,bytes:int}
324 + * @return array{entries:int,bytes:int,reason:string}
325 325 */
326 326 public static function purge_page( string $cause ): array {
327 327 $removed = Cache::purge_local();
328 328 $entries = (int) $removed['pages'] + (int) $removed['rest'] + (int) $removed['assets'];
@@ -339,10 +339,26 @@
339 339 // The public purge contract, which purge_all() publishes but
340 340 // purge_local() does not — without it `wp xspeed purge`, the
341 341 // dashboard button and the MCP purge tool would clear our files and
342 342 // leave LiteSpeed serving the stale page, having reported success.
343 - Cache::announce_purge( $cause, $entries );
343 + // The announce also reaches caches in front of PHP, such as nginx
344 + // through Nginx Helper; the row names them so the operator can tell
345 + // they were reached. (#654)
346 + $run = Cache::report_forwarding(
347 + static function () use ( $cause, $entries ): void {
348 + Cache::announce_purge( $cause, $entries );
349 + }
350 + );
344 351
352 + $reason = '';
353 + if ( array() !== $run['forwarded'] ) {
354 + $reason = sprintf(
355 + /* translators: %s: names of the caches in front of the site, e.g. "Nginx Helper". */
356 + __( 'also sent the purge to %s', 'xspeed' ),
357 + implode( ', ', $run['forwarded'] )
358 + );
359 + }
360 +
345 361 Cache_Inventory::invalidate();
346 362
347 363 Activity_Log::record(
348 364 'cache_purged',
@@ -357,8 +373,9 @@
357 373
358 374 return array(
359 375 'entries' => $entries,
360 376 'bytes' => (int) $removed['bytes'],
377 + 'reason' => $reason,
361 378 );
362 379 }
363 380
364 381 /**