Multi-CDN, failover and cost optimisation

When a second CDN is worth it, DNS-based and client-based steering, health-checked failover, log unification, and controlling egress and request costs.

When a second CDN pays for itself

MotivationDoes a second CDN solve itCheaper alternative
A provider outage took the site downSometimesBetter origin protection and a documented fallback
Latency in one regionYesA provider with better coverage there
Egress costYes, if rates differCache harder and shrink assets
Commercial leverageRarely worth the complexityNothing - negotiate on volume
Compliance requiring two providersYesNothing else works
Load balancing at extreme scaleYesFix the origin first

A second CDN doubles the operational surface: two configurations, two log formats, two purge APIs and two sets of rules to keep in sync. It is justified when a single provider's failure is unacceptable or when the cost difference is material - not as a general principle.

Steering traffic

MethodHowFailover speedComplexity
DNS-basedAnswer with different CNAMEs per providerTTL-boundLow
Weighted DNSSplit by percentage across providersTTL-boundLow
Client-basedThe page picks a provider and requests from itImmediateHigh, and needs client logic
Anycast with two backendsOne address, provider-side steeringFastProvider-specific
Full page versionA second hostname served by another providerManualLow, but manual
DNS steering that actually fails over

  primary    example.com  ->  primary CDN CNAME, TTL 60
  check      synthetic request every 30 s, from several regions
  threshold  three consecutive failures before switching
  switch     replace the answer to the secondary CNAME
  verify     confirm the new answer from two resolvers
  switch back only after the primary has been stable for 30 minutes

  Remember: a client that resolved just before the switch keeps using the
  old answer for the full TTL, so plan for a minute of mixed traffic.
  • Keep the TTL short on the record that steers, and long on everything else.
  • Health-check from outside the provider's network. A check inside the failing provider reports healthy.
  • Do not switch automatically on a single failure. A flapping record is worse than a short outage.
  • Rehearse the switch on purpose, in business hours, at least twice a year.

Cost control and log unification

  1. Get the numbers per asset class from each provider's logs: bytes, requests and cache status.
  2. Compute cost per 1000 requests and cost per GB for the same traffic on each provider. The ranking is rarely what the price list suggests.
  3. Shift the classes where one provider is clearly cheaper, and leave the rest alone.
  4. Aggregate logs into one schema. Two formats means two dashboards and no way to compare.
  5. Set a budget alarm on request count and egress separately. Attacks and misbehaving clients show up in the request count first.
  6. Review quarterly. Traffic mix changes and the cheapest option changes with it.
A single log schema for both providers

  time, cdn, pop, cache_status, url, status, bytes, ttfb_ms,
  client_country, user_agent_family, referer_host

With that, you can answer:
  what share of requests does each provider serve?
  what is the hit ratio for static assets per provider?
  what is the cost per GB after normalising the log volume?
  which provider is slower in the region that matters?
Cost leverEffectRisk
Longer TTLs on immutable assetsLarge on requests and origin loadNone if the URLs are hashed
Strip unused query parametersLarge on hit ratioMust not change the response
Serve fewer renditionsLarge on videoVisible quality loss
Block known scraper trafficMedium on requestsFalse positives
Compress and convert imagesMedium to large on egressQuality regression
Cache HTML at the edge brieflyLarge on origin loadStale content for a short window
Move cold storage to a cheaper tierMedium on storageSlower restore
⚠️
Two CDNs with cache keys that differ will produce different content for the same user depending on which one answers. Normalise cookies, query strings and Vary behaviour before adding the second provider, or you will spend the next quarter debugging a site that behaves differently depending on which edge answered.

FAQ

Is multi-CDN worth the complexity for a small site?
Almost never. A single provider plus a protected origin and a documented manual failover covers the realistic failure modes at a fraction of the cost.
How do I choose which CDN serves which traffic?
By asset class or region, and only when the difference is measurable. Splitting randomly across providers adds variance without a benefit.

Security at the edge: WAF, DDoS and bot management Measuring CDN performance and debugging cache issues

Last refreshed 2026-09-18.