| @@ -311,9 +311,22 @@ | ||
| 311 | 311 | $removed = Cache::purge_local(); |
| 312 | 312 | $entries = (int) $removed['pages'] + (int) $removed['rest'] + (int) $removed['assets']; |
| 313 | 313 | |
| 314 | 314 | Cache::update_stats( array( 'last_purge' => time() ) ); |
| 315 | - do_action( 'xspeed_after_purge_all', $cause ); | |
| 315 | + | |
| 316 | + // Isolated per listener, and the throw swallowed: this sweep is | |
| 317 | + // already done, and one listener (Critical CSS, Unused CSS, the | |
| 318 | + // Cloudflare edge purge) failing must not cancel the ones queued | |
| 319 | + // behind it or stop the announcement below. Same handling | |
| 320 | + // purge_all() gives this action. (QA #348) | |
| 321 | + Cache::do_action_isolated( 'xspeed_after_purge_all', $cause ); | |
| 322 | + | |
| 323 | + // The public purge contract, which purge_all() publishes but | |
| 324 | + // purge_local() does not — without it `wp xspeed purge`, the | |
| 325 | + // dashboard button and the MCP purge tool would clear our files and | |
| 326 | + // leave LiteSpeed serving the stale page, having reported success. | |
| 327 | + Cache::announce_purge( $cause, $entries ); | |
| 328 | + | |
| 316 | 329 | Cache_Inventory::invalidate(); |
| 317 | 330 | |
| 318 | 331 | Activity_Log::record( |
| 319 | 332 | 'cache_purged', |