includes/Edge/class-cdn-purger.php
CDN cache purger (Cloudflare / Varnish).
Class CDN_Purger
Purges third-party caches after the plugin\’s own cache is cleared.
class CDN_PurgerConstants
| Constant | Visibility | Value | Line |
|---|---|---|---|
TOKEN_CONSTANT | public | \'WPPO_CLOUDFLARE_API_TOKEN\' | 35 |
publicstatic purge_all()
public static function purge_all(string=\'all\' $type, =null $url_path): boolPurge the configured third-party cache. Parameter Type Default Description $typestring=\'all\'— Clear type (\’all\’ or \’single_page\’). $url_path=null— Page path for single-page clears (unused; edge purges are all-or-nothing).
Return: bool — True when no purge was needed or all requests succeeded.
privatestatic purge_litespeed()
private static function purge_litespeed(string $type, =null $url_path): voidPurge LiteSpeed/LSCache when purgeSync is enabled with stale handling. Parameter Type Default Description $typestring— Clear type (\’all\’ or \’single_page\’). $url_path=null— Page path for single-page clears.
Return: void.
publicstatic is_configured()
public static function is_configured(): boolWhether the configured purge service has everything it needs.
Return: bool.
privatestatic purge_cloudflare()
private static function purge_cloudflare(array $cache): boolPurge everything on Cloudflare for the configured zone. Parameter Type Default Description $cachearray— cache_settings values.
Return: bool.
privatestatic purge_varnish()
private static function purge_varnish(array $cache): boolSend PURGE requests to the configured Varnish endpoints. Parameter Type Default Description $cachearray— cache_settings values.
Return: bool.
privatestatic log_failure()
private static function log_failure(string $service, string $detail): voidSurface a failed edge-cache purge through the plugin\’s debug log. Parameter Type Default Description $servicestring— Provider name. $detailstring— Endpoint / reason.
Return: void.
Hooks
Hooks referenced in includes/Edge/class-cdn-purger.php: Hook Type Line Notes wppo_varnish_purge_max_urlsfilter 201 —