Learn
Cache-Control max-age vs s-maxage: Browser and CDN TTLs
Verdict, evaluated November 2026: set max-age for the browser and s-maxage for the CDN, and keep them deliberately ...
Cache invalidation is usually the cheap part of fixing stale content. The expensive part is what a careless purge does to your origin. At a 96% edge hit ratio, the origin sees 4 of every 100 requests. Wipe the entire cache and the first wave can send all 100, a 25x spike. This playbook covers purge by URL, tag and prefix, soft versus hard purge, realistic propagation times, purge-on-deploy automation and an emergency rollback checklist. Wiring scoped purges into a pipeline takes about half a day.
Cache invalidation marks cached objects as no longer fresh, so the next request must revalidate or refetch them from origin, while a hard purge deletes them outright. Under HTTP caching semantics defined in RFC 9111, a soft purge combined with stale-while-revalidate from RFC 5861 lets the edge keep serving while one background request per object refreshes it, which avoids the 25x origin spike a global hard purge can cause at a 96% hit ratio.
The terms are often used interchangeably, but they describe different state changes. Picking the wrong one is how a routine content fix becomes an origin incident.
Invalidation flips an object to stale without removing it. The next request triggers a conditional fetch to origin using If-None-Match or If-Modified-Since. If the content did not change, origin answers 304 and the edge keeps its bytes.
Purge, or hard purge, evicts the object. The next request is a full miss: complete transfer from origin, full latency, full egress cost.
Soft purge is a vendor term for invalidation triggered through an API. It is the default you should reach for, because it degrades gracefully when origin is slow or down.
A CDN purge touches only the CDN tier. Browser caches, service workers, a Varnish or nginx reverse proxy in front of origin, and application object caches all hold their own copies. When users still see old prices after a successful purge, one of those layers is the usual suspect.
A CDN stores objects under a cache key, not a URL. Depending on configuration, the key can include:
The practical consequence: /app.js and /app.js?v=2 are separate objects, and a Brotli and a gzip copy of the same file may be cached separately too. Before purging, list every variant the change affects. A URL purge that misses the Brotli variant leaves most modern browsers on the old file.
Most CDNs expose four scopes. They differ in precision, blast radius on origin, and the operational discipline they demand.
| Method | Scope | Origin impact | Best for | Main risk |
|---|---|---|---|---|
| URL | One exact key | Negligible | Single article, image, installer | Missed variants and query strings |
| Prefix or wildcard | Everything under a path | Moderate, scales with directory size | Templates, language trees, a product section | Paths rarely match business entities |
| Tag or surrogate key | Every object carrying a tag | Proportional to real dependencies | Product, article or author changes across many pages | Inconsistent tagging silently leaves stale pages |
| Global | Entire zone | Up to 1 divided by miss ratio, 25x at 96% hits | Security, legal, broken cache-key config | Origin overload and days of degraded hit ratio |
Precision scales inversely with origin risk, so the default should be the narrowest scope that provably covers the change.
Use soft purge for content corrections, price updates and publishing events. Pair it with Cache-Control directives such as max-age=300, stale-while-revalidate=60 and stale-if-error=86400, so revalidation happens in the background and an origin outage still serves the last good copy. Reserve hard purge for content that must never be served again: leaked private files, legal takedowns, or responses that were cached by mistake with user data.
Tag purging works by having origin attach a header listing entity identifiers to each response, for example product-4812, category-shoes and template-v14. The header name varies by vendor (Surrogate-Key and Cache-Tag are common), and the CDN usually strips it before the response reaches the client. One API call for product-4812 then invalidates the detail page, every listing that shows it and the JSON fragment behind search. The discipline cost is real: tags must be generated by the same code that renders the page, or they drift.
Propagation time depends on architecture, not marketing. As vendor documentation described it in 2025 and 2026, systems built on a global push channel advertise purges completing in roughly 150 ms to a few seconds, while queue-based invalidation systems such as Amazon CloudFront typically take one to several minutes. Amazon CloudFront also bills invalidation paths beyond a monthly included allowance.
Two further delays sit outside the vendor number. The API call itself may be rate limited, so purging 20,000 individual URLs can take longer than the propagation. Then browsers honor whatever max-age they already received, so a page cached for an hour in the browser stays old for that hour regardless of the edge.
Assume 20,000 requests per second at the edge, a 96% hit ratio, a hot working set of 50,000 objects, and 100 edge caches that each hold the set. Steady state origin load is 20,000 times 0.04, or 800 requests per second.
The arithmetic generalizes: peak origin multiplier after a hard purge approaches 1 divided by your miss ratio, so the better your hit ratio, the harder a global purge hits.
Manual purges belong to incidents. Routine freshness should come from headers and pipeline hooks.
For large-file and video workloads, BlazingCDN includes purge and cache warm-up through its REST API on every plan, alongside origin shield and request coalescing, which covers steps 3, 5 and the shield math above; the BlazingCDN features for cache control and purge list what each zone ships with.
This section did not exist in earlier versions of this guide, and it is the one you will need at 2 a.m.
Request three or four critical URLs from at least three regions. Compare the release ID or content hash embedded in the response body, then check the Age header (it should reset near zero after a hard purge), the vendor cache-status header (expect a miss or revalidated result on the first request, a hit on the second), and the ETag. On dashboards, watch origin requests per second and edge hit ratio for the 15 minutes after the purge.
| Change | Scope | Soft or hard | Reason |
|---|---|---|---|
| Media: corrected headline | Tag: article ID | Soft | Article appears on home, section and feed pages |
| Retail: price or promotion change | Tag: product or promotion ID | Hard if price is binding | A stale price can be a compliance problem |
| SaaS: frontend release | URL: HTML entry points and manifest | Soft | Hashed assets need no purge |
| Software: wrong installer published | URL: exact binary path | Hard | Revalidation could still serve the bad file during origin trouble |
| Language tree redesign | Prefix | Soft | Path matches the change boundary |
| Personalized pages cached publicly | Global, after fixing cache rules | Hard | Unknown scope of user data exposure |
Global hard purge is justified only when the damage scope is unknown or the content is harmful; every routine change maps to a narrower scope.
Cache invalidation marks objects stale so the CDN revalidates them with origin, while a CDN cache purge deletes them so the next request is a full miss. Invalidation lets origin answer 304 for unchanged content and allows stale serving during outages. Purge guarantees removal, which matters for harmful or legally restricted content, but costs more origin load.
An instant cache purge typically propagates globally in roughly 150 ms to a few seconds on push-based CDN architectures, per 2025 and 2026 vendor documentation, while queue-based systems often take minutes. API rate limits and browser max-age add further delay, so a purge being complete at the edge does not mean every user sees fresh content immediately.
To purge cache safely, use the narrowest scope (URL or tag), prefer soft purge, and serve responses with stale-while-revalidate and stale-if-error directives. Enable origin shield and request coalescing so concurrent misses collapse into one upstream fetch per object. Warm the most requested URLs immediately after purging so real users do not trigger the refill.
No, a CDN cache purge only clears the CDN tier, and browsers keep their copies until the max-age they received expires. Use hashed filenames for static assets so updates arrive under new URLs, keep HTML browser TTLs short, and reserve the Clear-Site-Data header for recovery cases where cached client data must be wiped.
Fingerprinted static assets should almost never be purged from a CDN cache, because each build produces new filenames that act as new cache keys. Purge assets only when a file is served under a stable name, such as an installer or a third-party embed. Keep previous asset versions on origin through at least one HTML TTL after release.
This week, export the last 30 days of purge events from your CDN logs or API audit trail. Count how many were global versus scoped, and overlay each one on origin requests per second and edge hit ratio for the following 15 minutes. If any purge pushed origin above 5x baseline, convert that trigger to a tag or URL purge, add stale-while-revalidate to the affected responses, and set an alert on origin load after purge events.
For teams delivering video, software or large files, BlazingCDN runs a 14-day testing period on real production traffic with the monthly minimum waived, long enough to wire API purge and warm-up into a staging pipeline and compare the origin curve: start a BlazingCDN testing period with purge and warm-up via API.
Heavy traffic.
Light bill.
The CDN for video and large traffic
Learn
Verdict, evaluated November 2026: set max-age for the browser and s-maxage for the CDN, and keep them deliberately ...
Learn
Evaluated November 2026 against RFC 9111 and current vendor documentation. The short answer on no-cache vs no-store: ...
Learn
A CloudFront invalidation removes cached objects from every Amazon CloudFront cache layer before their TTL expires. As ...
Learn
A global CDN has to keep cached bytes within roughly 20 to 40 ms of round-trip time from users on every continent you ...