Runbook Distributed Cloud & Security Intermediate Level PP-KB-006

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.

Elena Rostova
Elena Rostova Industrial Power SRE
Estimated Read 8 min read
Last Verified 2026-10-27
Corpus Status Production Edge

Key Architectural Outcomes & Takeaways

01

Instantaneous global cache invalidation using surrogate keys and cache-tags.

02

Failover routing SLA compliance: <15 seconds cross-datacenter failover.

03

Automated synthetic health probe verification across 300+ PoPs worldwide.

04

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 HEALTHY to UNHEALTHY.
  • 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:

bash
# 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:

bash
# 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:

json
{
  "$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

Verify API responses from at least 3 global regions using curl --resolve.
Confirm TLS 1.3 handshakes complete under 40ms from edge locations.
Check that Cache-Control: public, max-age=0, must-revalidate header is served.
Validate zero 5xx errors in Cloudflare Dashboard under Workers & Pages > Observability.
Back to Knowledge Catalog
How to build habit in 30 days with Linda ?
Mike Hardson Episode 12 . Industrial Revolution
00:00
00:27