includes/Edge/class-edge-purge-coordinator.php
Edge/CDN cache purge coordinator.
Class Edge_Purge_Coordinator
Coordinates legacy CDN and edge-cache purges for one cache-clear event.
final class Edge_Purge_Coordinatorpublicstatic purge_after_cache_clear()
public static function purge_after_cache_clear(=\'all\' $type, =null $url_path): boolRoute the shared post-clear hook through both existing purgers. Parameter Type Default Description $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.
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. Parameter Type Default Description $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.
privatestatic remember_cloudflare_response()
private static function remember_cloudflare_response($response, $args, $url, array& $seen, array& $pending): voidRecord a completed transport response for later duplicate suppression. Parameter Type Default Description $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.
privatestatic cloudflare_request_key()
private static function cloudflare_request_key($args, $url): stringBuild a stable key for one Cloudflare full-zone purge transport. Parameter Type Default Description $argsmixed— WordPress HTTP request arguments. $urlmixed— WordPress HTTP request URL.
Return: string — Stable key, or \’\’ for any other request.