Learn
How to Set Up a CDN: Step-by-Step Guide for Software Teams
How to set up a CDN for a software product comes down to six changes: a dedicated origin hostname, a CDN zone that ...
CDN caching stores copies of origin responses in a hierarchy of shared caches. Most requests are answered by an edge server near the user, and only misses travel up to a parent tier and then to the origin. The tiers multiply: with a 95% edge hit ratio and a 70% hit ratio at the parent tier, only 1.5% of all requests reach the origin (0.05 × 0.30, worked in 2026).
This article walks one request through every tier and separates the CDN cache from the browser cache. It then works through origin-load math for a patch release and lists the failure modes that quietly lower hit ratio, each paired with the header or metric that confirms it.
A CDN cache is a shared HTTP cache run by a content delivery network. It is a fleet of reverse proxies that store responses under a cache key, usually scheme, host, path and selected query parameters, and serve them until the freshness lifetime set by headers or CDN rules expires. One stored copy serves every user routed to that server.
That shared scope is what makes it different from a browser cache. HTTP caching semantics in RFC 9111 treat shared caches separately. They obey s-maxage over max-age, they must not store responses marked private, and they have to decide what to do with responses that set cookies. Inside a single server, the cache is itself layered. A small hot set lives in RAM, the long tail sits on NVMe or SSD, and eviction is usually some variant of LRU with admission filtering, so one-hit wonders do not flush popular objects.
A cache hierarchy is a tree with the origin at the root and edge servers at the leaves. Each tier exists to absorb misses from the tier below it. Read top to bottom, the hierarchy looks like this:
The origin holds the canonical images, video, builds and files, and it sets the caching policy through Cache-Control, ETag and Last-Modified. Every tier above it inherits its mistakes. A missing validator turns cheap 304 revalidations into full re-downloads.
Regional caches sit in large data centers and collect misses from many edges. When one regional node is designated the origin shield, every edge miss for a given origin funnels through it. Concurrent requests for the same object are then coalesced into a single origin fetch.
Tier 2 caches hold content popular in one market, such as a regional sports clip or a localized build. They keep that content one short hop from the edge and take repeated fills off the regional tier.
Edge servers terminate TLS and answer the bulk of requests. Their storage is the smallest per location, so they hold the head of the popularity curve. Edge hit ratio is the number most dashboards show.
Within a PoP, servers usually split the keyspace with consistent hashing, so each object is stored once per PoP rather than once per server. Older designs used inter-cache protocols such as ICP (RFC 2186) to query siblings. Peer sharing helps most for bandwidth-heavy streaming, gaming and large downloads, where duplicating a 20 GB file on every server wastes disk.
A CDN cache is shared across all users and controlled by the site operator, who can purge it. A browser cache is private to one user agent and cannot be purged remotely. The same response can carry different lifetimes for each: s-maxage or CDN-Cache-Control (RFC 9213) governs the CDN, while max-age governs the browser.
| Property | CDN cache | Browser cache |
|---|---|---|
| Scope | Shared by every user on that server | One user, one device |
| Lifetime directive | s-maxage, CDN-Cache-Control, CDN rules | max-age, Expires |
| Invalidation | Purge by URL, tag or prefix via API | Only by expiry or a new URL |
| Personalized content | Must be excluded or keyed carefully | Safe with Cache-Control: private |
Because only the CDN copy can be purged, long TTLs belong at the CDN and short TTLs belong in the browser, unless the URL is versioned.
A workable header policy follows from that. Fingerprinted assets get "public, max-age=31536000, immutable", since a new build means a new URL. HTML gets "max-age=0, s-maxage=300, stale-while-revalidate=60". Browsers revalidate every time, the CDN holds five minutes, and stale-while-revalidate lets the CDN serve while it refetches in the background.
Hit ratio at the edge undersells tiering, because the benefit concentrates in the long tail. Take one object requested once in each of 40 edge PoPs during its TTL. Without a parent tier, that is 40 origin fetches. With a shield, it is one fetch plus 39 parent hits. For a library of millions of rarely watched VOD segments, that 40-to-1 ratio is the difference between an origin sized for the catalog and one sized for new uploads.
The same arithmetic applies to a game patch. Suppose 1 million players download a 30 GB patch in its first 48 hours. Edge egress is 30 PB regardless of architecture. If three shield regions coalesce the first requests, origin egress is about 90 GB, three copies of the file. Without coalescing, every PoP that misses at once fetches its own copy, often in parallel. That is why release-day origin graphs spike even when steady-state hit ratio looks healthy. Pre-warming the parent tier before the release removes the remaining cold misses.
For this workload, BlazingCDN includes origin shield and request coalescing on every plan, caches objects up to 50 GB, and supports cache warm-up through its API, with a 96%+ average cache hit ratio. The CDN caching setup for game builds and patches describes how that applies to large releases.
| Workload | Request pattern | Tier setup | Metric to watch |
|---|---|---|---|
| Fingerprinted web assets | Small, hot head | Edge alone is usually enough | Edge hit ratio |
| VOD catalog | Long tail, large total bytes | Edge plus shield, large parent disk | Byte hit ratio at the parent |
| Live HLS or DASH | Very hot, seconds-long life | Shield with strict coalescing | Origin requests per segment |
| Game patches, installers | Burst on release, huge objects | Shield plus pre-warming | Origin egress in hour one |
| Personalized API responses | Unique per user | Bypass cache, or short micro-TTL | Uncacheable response share |
The colder and larger the catalog, the more a parent tier is worth, and edge hit ratio alone will not show it.
Most hierarchy problems look like a hit ratio that is a few points lower than expected, or an origin graph that does not match the traffic graph. These are the usual causes.
Tracking parameters, unordered query strings or Vary on User-Agent split one object into thousands of keys. It shows up as a high miss rate on objects you know are popular. Confirm it by counting distinct cache keys per path in your logs, then strip or sort query parameters in the key.
A Set-Cookie header, Cache-Control: private, or a missing lifetime can make a CDN skip storage entirely. The symptom is an origin request rate that tracks user traffic one to one for a content type. The Cache-Status header (RFC 9211), or the vendor's equivalent, reports the reason.
A global purge of a hot object, or synchronized expiry, sends every edge to the parent at once. Without coalescing, the herd reaches the origin. Confirm it by lining up origin request spikes with purge timestamps, then prefer soft purges and stale-while-revalidate.
If a tier ignores the incoming Age header, each tier restarts the clock. Worst-case staleness then becomes the sum of TTLs across tiers. Request the same URL twice and check that Age keeps growing past the edge TTL rather than resetting.
A cached 404 or 503 can outlive the incident that caused it, so give error responses short, explicit TTLs. A shield placed far from the origin also adds a long-haul hop to every miss. Compare miss latency at the shield with direct origin latency from the same region.
Start by classifying traffic by object size and popularity: hot assets, long-tail media, release bursts, uncacheable APIs. Then match each class to a row of the matrix above. Put the shield in the region nearest the origin, version every static URL, and set explicit lifetimes for every class, including errors.
To verify on your own stack, track three numbers per content class: edge hit ratio, byte hit ratio, and origin request ratio (origin requests divided by edge requests). If the origin ratio is well above edge miss rate times parent miss rate, coalescing or key normalization is broken somewhere.
Edge compute is moving cache key logic and personalization into the edge request path, which makes key hygiene more important, not less. 5G shortens the radio leg but leaves the backhaul. Caches inside operator networks are what remove that hop. Demand prediction for pre-warming is the most practical use of machine learning here, because release-driven traffic is forecastable.
A cache is any store that keeps copies of data to avoid refetching it. A CDN is a distributed network that runs many shared HTTP caches close to users, plus routing, TLS termination and purge tooling. Every CDN relies on caching, but a single cache in front of one origin is not a CDN, because it gives no geographic proximity.
No. A CDN cache is shared across all users and can be purged by the site operator through an API. A browser cache belongs to one user and expires only on its own schedule. Use s-maxage or CDN-Cache-Control to give the CDN cache a longer lifetime than the browser's max-age.
A CDN cache keeps an object until its freshness lifetime expires, it is purged, or eviction removes it to make room. The lifetime comes from s-maxage, max-age, CDN-Cache-Control or a CDN rule override. Unpopular objects can be evicted long before their TTL, which is why long-tail catalogs benefit from a large parent tier.
For static assets and media, a CDN cache hit ratio above 90% is a reasonable target, and well-tuned delivery of large files often runs higher. Track byte hit ratio and origin request ratio alongside it. A high request hit ratio can hide expensive misses on large objects, which dominate origin egress.
Yes. A miss that passes through a parent tier adds one internal hop, usually a few milliseconds to tens of milliseconds, depending on where the shield sits. The trade is worthwhile when the parent hit ratio is meaningful, because each parent hit avoids a slower origin round trip. Place the shield near the origin to keep that cost small.
Pull seven days of CDN and origin logs and compute the origin request ratio for each content class. Compare it with the edge miss rate multiplied by the parent miss rate. Any class where the real number is several times higher has a fragmented cache key, an uncacheable header or missing coalescing. The Cache-Status and Age headers will tell you which. Fix the worst class first and re-measure after one full TTL cycle.
If your traffic is large static objects such as video, builds or archives, the BlazingCDN features page lists the origin shield, request coalescing, purge and cache warm-up controls included on every plan.
Heavy traffic.
Light bill.
The CDN for video and large traffic
Learn
How to set up a CDN for a software product comes down to six changes: a dedicated origin hostname, a CDN zone that ...
Learn
Live course streaming in 2026 is a one-to-many video problem with a tight latency budget. Classic HLS with 6-second ...
Learn
A live HLS channel with 6-second segments and 100,000 concurrent viewers puts roughly 33,000 requests per second on the ...
Learn
To set up a CDN for static files, you need five things working together: a cacheable origin, a dedicated hostname ...