includes/Edge/class-edge-cache.php
Edge HTML Cache Adapter — Cloudflare Workers / Bunny Edge.
Class Edge_Cache
Edge cache adapter.
class Edge_CacheConstants
| Constant | Visibility | Value | Line |
|---|---|---|---|
FILTER_ENABLED | public | \'wppo_edge_cache_enabled\' | 38 |
FILTER_WORKER_CONTENT | public | \'wppo_edge_cache_worker_content\' | 46 |
FILTER_WRANGLER_CONTENT | public | \'wppo_edge_cache_wrangler_content\' | 54 |
FILTER_BUNNY_CONTENT | public | \'wppo_edge_cache_bunny_content\' | 62 |
TEMPLATE_MAX_BYTES | private | 1048576 | 166 |
publicstatic is_enabled()
public static function is_enabled(): boolWhether edge cache is enabled.
Return: bool — True when edge cache is enabled.
publicstatic is_configured()
public static function is_configured(): boolWhether edge purge has valid configuration.
Return: bool.
publicstatic get_config()
public static function get_config(): arrayGet adapter config for template generation.
Return: array{origin_url:string, — cache_ttl:int, swr:int, provider:string}.
privatestatic read_capped_template()
private static function read_capped_template(string $filename): stringRead an edge template file with a size bound. Parameter Type Default Description $filenamestring— Template file name under templates/.
Return: string — File contents, or \’\’ when unusable.
publicstatic get_worker_js()
public static function get_worker_js(array=array() $config): stringGet Cloudflare Worker JS content. Parameter Type Default Description $configarray=array()— Optional override config.
Return: string — Worker JS source.
publicstatic get_wrangler_toml()
public static function get_wrangler_toml(array=array() $config): stringGet wrangler.toml content for Cloudflare Workers deployment. Parameter Type Default Description $configarray=array()— Optional override config.
Return: string — wrangler.toml source.
publicstatic get_bunny_edge_js()
public static function get_bunny_edge_js(array=array() $config): stringGet Bunny Edge JS content (Edge Rules / pull zone adapter). Parameter Type Default Description $configarray=array()— Optional override config.
Return: string — Bunny edge JS source.
Hooks
Hooks referenced in includes/Edge/class-edge-cache.php: Hook Type Line Notes wppo_edge_cache_configfilter 143 @param ×1