Operational Objective
When deploying edge gateways routing mission-critical production traffic, zero-downtime is not optional. This field guide documents the standard operational procedure (SOP) established during global failover drills across 280+ edge data centers.
[Incoming User Traffic]
│
▼ (Anycast DNS)
[Cloudflare Edge PoP] ──(Health Check Fail?)──> [Automated Circuit Breaker]
│ │
▼ (Healthy) ▼ (Fallback)
[Active Worker Gateway] [Static Edge Fallback / S3]
Step 1: Pre-Flight Verification & Canary Allocation
Before pushing routing rule adjustments to live traffic, verify the canary routing weights:
# Verify current route split configuration
wrangler deployments list --env production
Inject a header-based override into the staging worker to test simulated latency:
export default {
async fetch(request: Request, env: Env): Promise<Response> {
const isCanary = request.headers.get("x-canary-test") === "true";
if (isCanary) {
return handleCanaryRoute(request, env);
}
return handleProductionRoute(request, env);
}
}
Step 2: Thundering Herd Mitigation (Stale-While-Revalidate)
When high-traffic cache keys expire, hundreds of simultaneous requests can hit your origin database. Prevent this by enforcing stale-while-revalidate headers directly at the edge layer:
Cache-Control: public, max-age=60, s-maxage=300, stale-while-revalidate=86400
Field Checklist
- Automated health checks pinging origin endpoints every 10 seconds.
- Fallback circuit breakers responding with cached payloads during origin brownouts.
- Rate-limiting rules configured to throttle bot scrapers without impacting authentic client sessions.