Cloudflare Edge Worker Multi-Region Failover & Cache Eviction Runbook
Operational runbook for diagnosing stale edge cache tags, purging cache tiers, and verifying global health check routing within 30 seconds of an outage.
Key Architectural Outcomes & Takeaways
Instantaneous global cache invalidation using surrogate keys and cache-tags.
Failover routing SLA compliance: <15 seconds cross-datacenter failover.
Automated synthetic health probe verification across 300+ PoPs worldwide.
Zero-downtime Canary deployments with progressive percentage splitting.
#Alert Trigger Conditions
This runbook is activated when Cloudflare Observability or Prometheus alerts on:
cf_worker_errors_5xx > 1.0%over a 3-minute sliding window.- Origin Health Check status transitions from
HEALTHYtoUNHEALTHY. - Stale content reports from regional users following emergency updates.
#Rapid Remediation: Global Cache Invalidation
To instantly purge cached assets across Cloudflare's Anycast edge without flushing unrelated resources, use targeted Cache-Tag Purging:
# 1. Purge specific cache tag (e.g. knowledge catalog updates)
curl -X POST "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/purge_cache" \
-H "Authorization: Bearer $CF_API_TOKEN" \
-H "Content-Type: application/json" \
--data '{"tags": ["knowledge-catalog", "api-routes"]}'
# 2. Verify purge across primary edge PoPs
curl -sI -H "Pragma: no-cache" https://paradigm-paradox.com/api/knowledge-catalog.json | grep -i "cf-cache-status"
# Expected response: CF-Cache-Status: EXPIRED or MISS (followed immediately by HIT on next load)
#Live Telemetry Streaming (Wrangler Tail)
Stream real-time exception logs directly from edge runtime isolates:
# Stream error events filtered by status code >= 500
npx wrangler tail paradigm-paradox-com-site --status error --format pretty
#Edge Worker Fallback Script Architecture
In wrangler.jsonc, ensure static asset fallback routing is configured:
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "paradigm-paradox-com-site",
"compatibility_date": "2024-10-01",
"build": {
"command": "npm run build"
},
"assets": {
"directory": "./dist",
"not_found_handling": "404-page"
}
}
#Incident Verification Steps
curl --resolve.
Cache-Control: public, max-age=0, must-revalidate header is served.