Your application can have a cache and still feel slow to users on another continent. It can also sit behind a CDN while every request passes through to the origin, producing a large bill without much acceleration. The CDN vs caching decision goes wrong when a delivery network and a storage mechanism are treated as interchangeable.
CDN vs caching is not an either-or choice: caching is the mechanism that stores reusable responses, while a CDN is a distributed delivery network that commonly uses shared edge caches plus routing and connection optimizations. If users are near one origin and server work is the bottleneck, local caching may be enough; if users are geographically distributed or origin bandwidth and traffic spikes matter, you normally need a CDN with a deliberate caching policy.
This guide separates the layers, shows where each request goes, and gives platform and DevOps teams a test plan for choosing the smallest setup that solves the measured problem.
CDN vs caching: the shortest correct answer
A cache is temporary storage plus the rules for reusing what it holds. A browser cache, application cache, reverse-proxy cache, and CDN edge cache all fit that definition, but they live in different places and serve different populations. RFC 9111 defines an HTTP cache as a local store of response messages and the subsystem that manages storage, retrieval, and deletion.
A content delivery network is infrastructure: a geographically distributed set of edge locations that accepts requests, chooses a serving location, and delivers content closer to users. Caching is one of its most important mechanisms, not the whole product. A CDN may also optimize DNS or anycast routing, TLS connection setup, HTTP/3 transport, request collapsing, origin shielding, logging, and failover.
The relationship is simple:
- You can cache without a CDN, such as in a browser, Redis, an application process, or a reverse proxy beside the origin.
- A CDN can proxy traffic that it does not cache, although those requests still depend on the origin response.
- The common high-performance design uses several caches together: browser, CDN edge, shield or reverse proxy, and application/data caches.
Saying “we have caching” therefore does not tell you whether first-time visitors in distant regions get a short network path. Saying “we have a CDN” does not tell you whether responses are reusable, whether cache keys fragment traffic, or whether the origin is actually offloaded.
How caching works without a CDN
Caching solves repeated work. A stored response can be served again while it is fresh; a stale response may be revalidated with the origin using a validator such as an ETag. That can reduce response time, bytes transferred, and application work even when every component lives in one region.
Browser cache
A browser cache is private to one client. It is ideal for versioned JavaScript, CSS, fonts, images, and other assets a returning visitor should not download again. It offers the shortest possible path—a local device—but it does nothing for a first-time visitor and cannot share one cached copy across users.
Browser caching is controlled mainly with response headers. For an asset whose URL changes whenever its bytes change, a long lifetime is safe:
Cache-Control: public, max-age=31536000, immutable
For HTML that should be checked before reuse, a shorter lifetime or revalidation policy is safer. no-cache permits storage but requires successful revalidation before reuse; no-store prevents storage. That distinction follows the Cache-Control semantics in RFC 9111 and prevents a common configuration mistake.
Origin, application, and data caches
An origin-side page cache can store rendered HTML so the application does not rerun templates and database queries for every request. An object cache can keep expensive query results or API objects in memory. These layers reduce server compute, but the user still crosses the full distance to the origin region.
That is often sufficient for an internal tool, a low-traffic site with a regional audience, or a highly personalized application whose responses cannot safely be shared. The bottleneck determines the layer: cache database work when database work is slow; cache rendered output when rendering is slow.
Reverse-proxy cache
A reverse proxy such as Varnish or NGINX can hold HTTP responses in front of an application. It shares cached content across users and keeps requests away from application workers, but a proxy in the same data center does not solve long-distance delivery. MDN classifies reverse proxies and CDNs as managed caches, both of which require explicit operational rules.
How CDN caching changes the request path
A CDN puts shared caches in multiple edge locations. On a hit, the selected edge sends its stored response to the user. On a miss, it retrieves or revalidates the response from the origin, forwards it to the user, and may store a copy for later requests through that cache.
Google Cloud's CDN overview documents the same hit-and-miss sequence and makes an important limitation clear: cache fill is reactive. An object stored at one edge is not automatically guaranteed to exist at every edge. A first request, an evicted object, or an expired entry can still reach the origin.
That distributed placement changes four things:
- Distance: cache hits travel from a nearby edge rather than a distant origin.
- Shared reuse: one stored response can serve many users routed to that cache.
- Origin offload: hits remove requests and delivered bytes from the origin path.
- Failure and spike behavior: fresh or permitted stale responses can continue serving while repeated misses are consolidated or shielded.
Caching is still doing the reuse. The CDN supplies geographic distribution, request routing, a managed control plane, and a network sized for delivery. The broader advantages of a CDN only materialize when those network capabilities and cache behavior work together.
CDNs can also improve uncached traffic by terminating connections near users and carrying requests across an optimized backbone, but an uncached dynamic response still needs origin compute and a return trip. Do not use a fast proxy hop to hide an overloaded application.
CDN vs caching comparison
| Question | Caching without a CDN | CDN with edge caching |
|---|---|---|
| What is it? | A reuse mechanism at the browser, app, data, or origin proxy layer | A distributed delivery service using caches at many edge locations |
| Who can reuse an entry? | One browser or users reaching the same origin-side cache | Users routed to the same edge or cache tier |
| Does it shorten geographic distance? | Browser cache does; origin-side caches do not | Yes, on edge hits |
| Does it reduce application work? | Yes, if placed before the expensive work | Yes on hits; misses still need the origin unless shielded |
| Does it reduce origin egress? | Browser hits can; origin-side page caches usually do not | Yes when bytes are served from edge cache |
| Helps first-time visitors? | Origin caching helps compute time, not distance | Yes after the relevant edge is warm; cold misses still reach origin |
| Best fit | Regional, low-traffic, compute-bound, or highly personalized workloads | Global audiences, large assets, media, downloads, and bursty repeat traffic |
| Main risk | Stale data or caching at the wrong layer | Poor cache keys, unsafe shared caching, invalidation errors, and paying for mostly misses |
| Primary metrics | Render/query time, local hit ratio, origin CPU | Edge hit ratio, regional TTFB, origin bytes, fill latency, purge time |
The table points to a rule that marketing pages often skip: “closer” only helps when the requested representation is present and reusable. Cacheability, cache keys, object popularity, TTLs, and eviction decide how often the network can deliver that advantage.
CDN vs caching: a practical decision framework
Start with the slow or expensive path, not a feature checklist.
Use caching without a CDN when the problem is local compute
Choose browser and origin-side caching first when most users are close to the origin, traffic is modest, and profiles show repeated rendering, queries, or downloads as the constraint. This keeps the architecture simple and can remove the dominant cost.
Confirm the choice from several regions. A fast server-side cache can produce a 20 ms response inside its own region and still make a distant user wait on network round trips.
Add a CDN when distance, bytes, or bursts dominate
A CDN is the stronger choice when users are distributed, assets are large, the same public objects are requested repeatedly, origin egress is expensive, or launches and live events create bursts. Images, scripts, software packages, VOD files, and immutable HLS or DASH segments are natural candidates.
For video, segment duration, object popularity, range requests, and manifest freshness all affect the result. The CDN for video guide covers that delivery path separately.
Use a CDN even when most responses are dynamic—carefully
An API or personalized application may still benefit from edge TLS termination, routing, and selective caching of public responses. Do not force user-specific pages, carts, account data, or authorization-dependent responses into a shared cache merely to raise the hit ratio. MDN warns that personalized content in a shared cache can leak to other users; mark it private or no-store and verify the CDN respects the policy.
Combine layers for a global application
Most production systems do not pick one layer. Browser caching avoids repeat downloads for the same user. Edge caching shares public responses near audiences. A shield or regional proxy consolidates misses. Application and data caches reduce the cost of requests that must reach the origin.
Each inner layer is the fallback for a miss at the layer before it. That makes the stack faster and more resilient, but it also makes freshness harder: every layer needs an explicit owner, TTL, invalidation path, and observable status.

How to combine a CDN and caching without serving the wrong content
Treat cache configuration as application logic. A bad rule can expose private data or keep an old price live; a good one is specific, testable, and reversible.
1. Classify responses before setting TTLs
Group responses by behavior rather than file extension alone:
- Immutable public assets: content-hashed JS, CSS, fonts, images, downloads, and finished media segments.
- Public but changing content: product pages, articles, catalogs, manifests, and public API responses.
- Personalized or sensitive content: sessions, carts, account pages, authorization-dependent APIs, tokens, and signed responses.
- Writes and non-idempotent actions: checkout, upload, update, and delete requests, which generally should not be cached as reusable responses.
Set the safest default, then opt public content into shared caching. Cloudflare's current cache documentation, for example, notes that static assets are cacheable by default while dynamic HTML is not, unless rules change that behavior (Cloudflare cache documentation).
2. Separate browser and shared-cache lifetimes
Use max-age for browser freshness and s-maxage when a shared cache should use a different lifetime:
Cache-Control: public, max-age=60, s-maxage=3600, stale-while-revalidate=30
ETag: "catalog-2026-07-09-v7"
In this example, a browser may reuse the response for 60 seconds while a shared cache may hold it for one hour. After expiry, the ETag can support a conditional request; the companion guide explains how ETags validate cached representations.
3. Design the cache key before chasing hit ratio
A cache key must separate representations that can differ, but every unnecessary dimension splits reuse. Forwarding every cookie, query parameter, and request header can turn one popular URL into thousands of low-frequency objects. Ignoring a meaningful language, encoding, authorization, or transformation input can serve the wrong variant.
Write down which inputs change the response. Include only those inputs in the key, normalize them where safe, and use Vary deliberately. Test two requests that should match and two that must remain separate.
4. Version immutable objects; purge changing objects
Give immutable assets content-hashed filenames and long TTLs. A deployment publishes a new URL instead of trying to erase every old copy. Use targeted purge or surrogate-key invalidation for changing pages and APIs, then verify the purge in multiple regions.
Do not confuse expiry with eviction. A cache may evict a fresh but unpopular object to make room, so a long TTL does not guarantee a hit. Google documents this distinction explicitly in its cache expiration and eviction guidance.
5. Protect the origin from concentrated misses
Many edges can miss the same object at once after a purge or release. An origin shield adds a shared cache tier between edges and origin, increasing the chance that only one upstream fill reaches the application. Request collapsing can reduce duplicate concurrent fills further.
This is the layer where the two halves of the article meet: shielding is a caching decision, but you need a delivery network to place the tiers. ZeroBuffer provides both — a shared edge tier, an origin shield above it, and instant global purge so the invalidation path stays testable — priced at a flat $0.0049/GB in every region. The flat rate matters here specifically because miss traffic is the hardest part of a cache design to forecast: a rate card that varies by geography makes a bad cache-hit month expensive in a way that is hard to predict in advance.
6. Measure the result, not the enabled toggle
Track edge hit ratio by status and asset class, regional TTFB, cache-fill latency, origin requests and bytes, eviction or bypass reasons, stale responses, and purge completion time. AWS defines cache hit ratio as the share of viewer requests served directly from the cache; useful as that is, one aggregate percentage can hide a critical API that never hits or a large video class that dominates bytes.
Use both request hit ratio and byte hit ratio. Ten thousand cached icons can make the request ratio look healthy while a few uncached 2 GB files drive most origin egress.
Common CDN and caching mistakes
Turning on a CDN without checking response status. Confirm hits, misses, bypasses, and age using response headers and provider logs. The RFC-defined Age header indicates how long ago a response was generated or validated, although its absence alone does not prove an origin request.
Using no-cache when you mean no-store. no-cache requires revalidation; it does not prohibit storage. Use no-store for responses that must not be stored by any cache.
Caching personalized HTML under a public key. Test authenticated and anonymous sessions with different users. A high hit ratio is a failure if the cached object crosses an authorization boundary.
Purging the CDN but forgetting browsers or inner caches. A CDN purge does not reach copies already held in private browser caches, and an application cache can regenerate stale data after an edge purge. Version assets and document invalidation from the data source outward.
Testing only a warm cache. Measure cold miss, warm hit, stale revalidation, post-purge concurrency, and origin failure. Users encounter all five states.
Treating hit ratio as the business outcome. The goal is lower user latency, origin load, and delivered cost without incorrect content. Track those outcomes beside the cache metric.
A seven-step deployment test
- Capture a baseline for regional TTFB, download time, origin requests, CPU, and egress.
- Select one safe asset class with meaningful traffic, such as versioned images or static bundles.
- Define its cache key, browser TTL, shared TTL, validator, and purge owner.
- Send requests from priority regions and record cold miss, warm hit, and
Agebehavior. - Change the object and prove that versioning or targeted purge exposes the new response everywhere tested.
- Run a controlled burst after a purge and inspect shield or request-collapse behavior at the origin.
- Compare user latency, origin requests, origin bytes, and total delivery cost with the baseline.
Expand only after the evidence is clean. Add changing public content next; keep personalized responses out until isolation tests prove the cache key and bypass policy.
Frequently asked questions
Is a CDN the same as a cache?
No. Caching is a mechanism for storing and reusing data or responses. A CDN is a geographically distributed delivery network that commonly uses caches at its edges, along with routing, connection handling, observability, and other delivery capabilities.
Does a CDN work without caching?
Yes, a CDN can proxy and optimize uncached traffic, but every uncached response may still require origin processing and origin-to-edge transfer. The largest latency, offload, and egress benefits usually come from making safe, reusable content hit at the edge.
Can a CDN replace browser caching?
No. A CDN cache is shared infrastructure near users, while a browser cache is private storage on one user's device. Use both: the CDN helps first-time and geographically distant users after an edge is warm, and the browser avoids repeat downloads on the same device.
What content should not be cached by a CDN?
Do not shared-cache tokens, session-specific responses, private account data, carts, or authorization-dependent content unless the cache design can prove strict isolation. Use Cache-Control: private for browser-only storage or no-store when the response must not be stored.
What is edge caching?
Edge caching stores reusable HTTP responses at network locations close to users. It is the caching mechanism inside many CDNs, not a separate alternative to a CDN; “edge” describes where the shared cache runs.
Conclusion: choose the layer that removes the measured bottleneck
Use browser, application, or origin caching when repeated local work is the real constraint. Add a CDN when distance, large delivered bytes, origin egress, or distributed traffic spikes matter. For most global public workloads, the answer to CDN vs caching is both: cache correctly at several layers and use the CDN to place shared copies near users.
Do not buy the diagram. Run the seven-step test on one representative asset class, verify freshness and isolation, and expand only when regional latency, origin traffic, and cost move in the right direction.
When you run that test, run it on a network you can start measuring the same day. ZeroBuffer delivers from 100+ edge locations across six continents at 25 ms average global latency, with origin shielding, configurable cache policies, and instant purge — at a flat $0.0049/GB priced by volume rather than geography, stepping down to $0.0035/GB above 750 TB. No contracts, no minimums, free to start with no card. See the full rate card.
