class-edge-purge-coordinator.php

Edge/CDN cache purge coordinator.

Source includes/Edge/class-edge-purge-coordinator.php2 min readPart of Performance Optimisation

includes/Edge/class-edge-purge-coordinator.php

Edge/CDN cache purge coordinator.

Namespace: PerformanceOptimise\\Inc · Lines: 150

Class Edge_Purge_Coordinator

Coordinates legacy CDN and edge-cache purges for one cache-clear event.

Source: includes/Edge/class-edge-purge-coordinator.php, line 30

final class Edge_Purge_Coordinator

Tags: @since NEXT

publicstatic purge_after_cache_clear()

public static function purge_after_cache_clear(=\'all\' $type, =null $url_path): bool

Route the shared post-clear hook through both existing purgers.

ParameterTypeDefaultDescription
$type=\'all\'—Clear type (\’all\’ or \’single_page\’).
$url_path=null—Page path for a single-page clear.

Return: bool — True when every available provider path succeeded or no-opped.

Tags: @since NEXT

Source: includes/Edge/class-edge-purge-coordinator.php, line 41

privatestatic deduplicate_cloudflare_request()

private static function deduplicate_cloudflare_request($pre_response, $args, $url, array& $seen, array& $pending)

Reuse the first response for an identical Cloudflare full-zone purge.

ParameterTypeDefaultDescription
$pre_responsemixed—Response from an earlier pre_http_request listener.
$argsmixed—WordPress HTTP request arguments.
$urlmixed—WordPress HTTP request URL.
$seenarray&—Responses already seen during this coordinator event.
$pendingarray&—Requests currently awaiting an http_api_debug response.

Return: mixed — Unchanged earlier response, or the cached response for a duplicate.

Tags: @since NEXT

Source: includes/Edge/class-edge-purge-coordinator.php, line 81

privatestatic remember_cloudflare_response()

private static function remember_cloudflare_response($response, $args, $url, array& $seen, array& $pending): void

Record a completed transport response for later duplicate suppression.

ParameterTypeDefaultDescription
$responsemixed—HTTP API response.
$argsmixed—WordPress HTTP request arguments.
$urlmixed—WordPress HTTP request URL.
$seenarray&—Responses already seen during this coordinator event.
$pendingarray&—Requests currently awaiting an http_api_debug response.

Return: void.

Tags: @since NEXT

Source: includes/Edge/class-edge-purge-coordinator.php, line 110

privatestatic cloudflare_request_key()

private static function cloudflare_request_key($args, $url): string

Build a stable key for one Cloudflare full-zone purge transport.

ParameterTypeDefaultDescription
$argsmixed—WordPress HTTP request arguments.
$urlmixed—WordPress HTTP request URL.

Return: string — Stable key, or \’\’ for any other request.

Tags: @since NEXT

Source: includes/Edge/class-edge-purge-coordinator.php, line 129