| @@ -133,9 +133,9 @@ | ||
| 133 | 133 | self::forward_nginx_helper( $context ); |
| 134 | 134 | } catch ( \Throwable $e ) { |
| 135 | 135 | if ( defined( 'WP_DEBUG' ) && WP_DEBUG && function_exists( 'error_log' ) ) { |
| 136 | 136 | // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- built-in integration failure after local invalidation. |
| 137 | - error_log( '[xspeed] nginx FastCGI response purge failed: ' . $e->getMessage() ); | |
| 137 | + error_log( '[xspeed] Nginx Helper response purge failed: ' . $e->getMessage() ); | |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
| @@ -333,9 +333,9 @@ | ||
| 333 | 333 | : 'complete'; |
| 334 | 334 | |
| 335 | 335 | // Nothing to decide on a site with no nginx zone, so the filter below |
| 336 | 336 | // is only asked when there is one. |
| 337 | - if ( ! Host_Page_Caches::nginx_helper_is_fastcgi() ) { | |
| 337 | + if ( null === Host_Page_Caches::nginx_helper_page_cache() ) { | |
| 338 | 338 | return; |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | if ( 'content' === $intent ) { |
| @@ -440,17 +440,20 @@ | ||
| 440 | 440 | * shutdown and runs once, after every change the request makes. Clearing |
| 441 | 441 | * the zone covers every URL queued before it, so those are dropped. |
| 442 | 442 | */ |
| 443 | 443 | private static function purge_nginx_zone(): void { |
| 444 | - self::note_forwarded( 'Nginx Helper' ); | |
| 445 | 444 | self::$nginx['urls'] = array(); |
| 446 | 445 | self::$nginx['overflow'] = false; |
| 447 | 446 | if ( self::$nginx['zone_done'] ) { |
| 447 | + self::note_forwarded( 'Nginx Helper' ); | |
| 448 | 448 | self::$nginx['zone_again'] = true; |
| 449 | 449 | self::arm_nginx_flush(); |
| 450 | 450 | return; |
| 451 | 451 | } |
| 452 | + // Named only once it was sent: a listener on Nginx Helper's action | |
| 453 | + // that throws means the zone was not cleared. (#654) | |
| 452 | 454 | if ( Host_Page_Caches::purge_nginx_helper() ) { |
| 455 | + self::note_forwarded( 'Nginx Helper' ); | |
| 453 | 456 | self::$nginx['zone_done'] = true; |
| 454 | 457 | } |
| 455 | 458 | } |
| 456 | 459 | |
| @@ -524,9 +527,11 @@ | ||
| 524 | 527 | self::$nginx['overflow'] = false; |
| 525 | 528 | self::$nginx['zone_again'] = false; |
| 526 | 529 | self::$nginx['armed'] = false; |
| 527 | 530 | |
| 528 | - if ( ! Host_Page_Caches::nginx_helper_is_fastcgi() ) { | |
| 531 | + // Either mode takes a zone clear; only URLs queued under FastCGI | |
| 532 | + // reach the per-URL branch below. | |
| 533 | + if ( null === Host_Page_Caches::nginx_helper_page_cache() ) { | |
| 529 | 534 | return; |
| 530 | 535 | } |
| 531 | 536 | if ( $work['zone_again'] ) { |
| 532 | 537 | Host_Page_Caches::purge_nginx_helper(); |