CDN Failover Testing Guide: How to Keep Websites Available When the Origin Goes Down
CDN reliabilityfailoverorigin serversdisaster recoverywebsite uptime

CDN Failover Testing Guide: How to Keep Websites Available When the Origin Goes Down

CCache Cloud Editorial Team
2026-11-09
8 min read

A practical CDN failover testing workflow covering health checks, backup origins, DNS, TLS, caching, monitoring, and rollback.

A CDN failover test verifies that visitors can still receive a safe, usable response when the primary origin becomes unavailable. This guide provides a provider-neutral testing workflow, an architecture comparison, a recurring checklist, and practical rollback steps for validating health checks, backup origins, DNS, TLS, caching, and monitoring.

Overview

CDN origin failover is the process of routing requests from a failed primary origin to a healthy backup origin, usually through a CDN, reverse proxy, load balancer, or traffic-management layer. The objective is not simply to prove that a second server exists. You must verify that the complete request path works under failure conditions: DNS resolves correctly, the CDN detects the failure, the backup origin accepts the request, TLS validation succeeds, cache rules behave as expected, and monitoring identifies the event.

A typical architecture looks like this:

Visitor → DNS → CDN or reverse proxy → primary origin → backup origin when required

The exact feature names differ between providers. One dashboard may call the mechanism origin failover, another may use origin pools, backend groups, health checks, or load balancing. The underlying questions remain similar:

  • What condition marks the primary origin as unhealthy?
  • How quickly does traffic move to the backup?
  • Which URLs, methods, headers, and cookies are sent to the backup?
  • Will the backup serve current content, a read-only version, or a maintenance response?
  • How does traffic return to the primary after recovery?

Do not treat cached pages as proof that failover works. A CDN may continue serving an existing object while the origin is down, masking a broken backup path. Test both cache hits and cache misses, and record whether a response came from the edge, the primary origin, or the backup origin. For related cache verification methods, see How to Check if a Website Is Cached.

Architecture comparison

ArchitectureWhat fails overWhat to verify
CDN origin poolRequests move between configured originsHealth-check behavior, origin priority, retries, and cache interaction
CDN plus origin shieldThe shield layer selects a healthy originShield health, regional routing, and whether edge nodes can reach the shield
DNS failoverDNS returns a different endpointTTL effects, resolver caching, TLS coverage, and stale DNS responses
Load balancer with backup poolThe load balancer changes backend selectionProbe paths, connection draining, session behavior, and recovery rules
Application-level fallbackThe application serves a degraded responseRead-only behavior, dependency failures, and data consistency

What to track

Create a small failover record that can be compared after every infrastructure change. The following variables are more useful than a single uptime result.

Health-check configuration

  • Probe URL: Use a lightweight endpoint that confirms the application is able to serve traffic. A static success response may not detect database or application failures, while a complex page may create unnecessary load.
  • Expected status: Define which HTTP status indicates health. Document whether redirects, authentication responses, or other statuses are accepted.
  • Method and headers: Record whether the check uses GET, HEAD, a host header, or an authentication token. The probe must test the same routing path visitors use.
  • Failure threshold: Note how many failed probes trigger failover and how many successful probes are required for recovery. Avoid assuming that a dashboard label has the same meaning across providers.
  • Probe locations: Record whether checks come from one region or multiple locations. A local network problem should not necessarily remove a healthy origin from service.

Request and response evidence

For each test, save the timestamp, hostname, URL, response status, response time, cache status, selected origin, and a request identifier if available. Capture headers such as Age, Via, CF-Cache-Status where applicable, or the equivalent provider-specific header. These values are clues, not universal standards, so interpret them using your provider's documentation.

Test at least four request types:

  1. A cacheable static asset, such as a versioned CSS or JavaScript file.
  2. An HTML page that is normally cached or revalidated.
  3. A deliberately uncached or cache-busted URL to force an origin request.
  4. A dynamic or authenticated route that should not be served from a shared cache.

For cache policy details, compare your results with the Cache-Control Headers Guide. If static assets are updated during recovery, confirm that asset versioning prevents visitors from receiving incompatible files; the cache-busting guide covers common approaches.

Backup-origin readiness

Track whether the backup has the required application code, environment variables, database access, media files, certificates, firewall rules, and DNS or hostname configuration. A backup can pass a basic health check yet fail on a real page because it cannot reach a dependency or does not have current content.

Record the intended recovery mode: full service, read-only service, static emergency site, or maintenance page. The acceptable response depends on the application. For example, an online store may need to disable checkout rather than risk inconsistent orders, while a documentation site may be able to serve a static snapshot.

Cadence and checkpoints

Run a controlled CDN failover test before a major launch, after an origin migration, after changing DNS or TLS, and after modifying CDN rules. A monthly or quarterly review is also useful when the infrastructure changes less frequently. The schedule should be recorded in the same operational calendar as backup restoration tests and certificate reviews.

Stage 1: Review without causing an outage

Start by exporting or documenting the current configuration. Check origin hostnames, ports, certificates, SNI settings, firewall allowlists, health-check paths, cache rules, purge permissions, and monitoring alerts. Confirm that the backup origin is reachable from the CDN's network rather than only from an administrator's workstation.

Stage 2: Test a non-production path

Use a staging hostname or isolated origin pool if your platform supports it. Send requests with command-line tools and inspect headers:

curl -sS -D - -o /dev/null https://www.example.com/health
curl -sS -D - -o /dev/null 'https://www.example.com/test-failover?cache_bust=2026-10-30'

These commands show response headers without printing the page body. Replace the hostname and path with approved test values. Do not send destructive methods such as POST to a backup environment unless the test plan explicitly covers data behavior.

Stage 3: Simulate primary-origin failure

Prefer a reversible simulation: remove the primary from the origin pool, block the CDN's health-check traffic at the primary, return a controlled failure from a test endpoint, or route a test hostname to an intentionally unavailable backend. Avoid shutting down a production server without an approved maintenance window and a documented owner.

During the simulation, request cache hits and misses from more than one network. Verify that the CDN stops sending new requests to the primary, the backup returns the expected content, and dynamic routes follow their intended policy. Watch application logs on both origins to confirm where requests are arriving.

Stage 4: Restore and test rollback

Return the primary to service using the documented change method. Confirm that health checks recover, traffic returns according to the configured policy, and no stale failure state remains. If you use DNS failover, allow for resolver and local DNS caching; a DNS change may not be visible everywhere immediately. If you use CDN failover, check whether existing connections or cached errors require a purge or a wait period.

Finish by recording the actual detection time, failover time, recovery time, user-visible behavior, and any manual steps. A test that requires undocumented intervention is a reliability finding, not a failed exercise to hide.

How to interpret changes

A successful failover test does not mean every failure mode is covered. Compare results with previous tests and investigate changes in these areas:

  • Failover takes longer: Review health-check intervals, thresholds, retry settings, connection timeouts, and whether the CDN is waiting for an origin response before selecting the backup.
  • Cached content works but uncached content fails: The edge layer is masking an origin or backup problem. Check the backup hostname, firewall rules, application dependencies, and cache-bypass behavior.
  • HTML works but assets fail: Check asset hostnames, certificate coverage, origin paths, versioned files, and whether the backup contains the same build.
  • Public pages work but logged-in routes fail: Review cookies, authorization headers, session storage, and cache rules. Never make a private response publicly cacheable merely to improve the failover result.
  • Traffic returns to the primary too quickly: Confirm that the primary is genuinely ready, not merely answering a shallow health check. A deeper readiness endpoint may be appropriate.
  • Users see old content: Determine whether stale content is an intentional continuity measure or an accidental cache state. Document the acceptable freshness window and the purge procedure.

Track cache hit ratio and origin response time separately during the exercise. A higher cache hit ratio can reduce pressure on a failed origin, but it can also conceal that the backup cannot serve a cache miss. Use the cache hit ratio guide alongside origin logs rather than treating cache performance as an availability measurement.

For DNS-based designs, use a DNS inspection tool or DNS speed test from multiple locations and resolvers. A low DNS lookup time does not prove that failover propagation is complete. For TLS, test the public hostname against the backup path and confirm that the certificate's names, SNI routing, protocol settings, and trust chain remain valid.

When to revisit

Revisit this article and your failover record monthly or quarterly, depending on how often the platform changes. Perform an additional review whenever you change the CDN, reverse proxy, DNS provider, hosting provider, origin hostname, TLS certificate, firewall, cache policy, deployment process, database, or authentication system.

Use this compact checklist for the next review:

  1. Confirm the primary and backup origins, ownership, and current configuration.
  2. Verify health-check paths, expected statuses, thresholds, and probe locations.
  3. Test DNS resolution, TLS, CDN routing, cache hits, cache misses, and dynamic requests.
  4. Simulate a reversible primary-origin failure during an approved window.
  5. Measure detection, failover, recovery, and user-visible response times.
  6. Check logs, alerts, cache behavior, content freshness, and data safety.
  7. Restore normal routing and confirm that rollback is complete.
  8. Update the runbook with every manual step, unexpected result, and configuration change.

Keep the final test record with your disaster-recovery documentation. When the next origin outage occurs, the value of the exercise will be measured less by the dashboard status than by whether the team knows what visitors receive, which data remains safe, and how to restore normal delivery without guesswork.

Related Topics

#CDN reliability#failover#origin servers#disaster recovery#website uptime
C

Cache Cloud Editorial Team

Infrastructure Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.