concept Delivery & performance
CDN
Understand how a CDN serves nearby edge responses, when it contacts origin, and why not all content is cached.
What it means
A content delivery network (CDN) operates distributed edge services between visitors and a website's origin. Its edges can cache eligible responses and deliver them without contacting the origin every time. Depending on the product and configuration, the CDN may also proxy requests, route traffic or apply security policies. It is not synonymous with DNS, and a CDN is not simply a browser cache. HTTP caching CDN behavior
A nearby edge can reduce repeated long-distance transfers for cacheable content, but there is no universal speed guarantee: a miss still needs origin work, and connection and application costs remain.
Try it
Example — three paths for a fictional image URL. These are possible outcomes, not live cache-status observations.
| Edge condition | What can happen |
|---|---|
| Fresh cached image | Edge returns stored bytes without an origin fetch |
| No usable stored response | Edge requests the origin and may cache an eligible response |
| Personalized or excluded response | Edge forwards to origin or handles it without normal cache reuse |
Visitor --> CDN edge --> [cached object?]
| yes: return stored response
+ no: origin request --> responseThe response is reusable only if the relevant method, status, cache directives and cache key permit it. Some CDNs cache selected static extensions by default but not generic HTML; others provide rules to change that behavior. Cookies, authorization, variations and separate browser/edge TTLs matter. Provider example
The origin is still part of the system
The origin remains authoritative for content, unless an intentionally designed alternative supplies it. A cache miss, expired object requiring validation, uncached API call or certain errors can still contact origin. Revalidation may use an ETag or last-modified validator rather than downloading a full representation. Revalidation
A purge or invalidation request can remove/revalidate edge copies under the provider's rules, but does not guarantee that every browser cache or another intermediary discards its own copy. Likewise a CDN's cache hit does not prove that the origin currently works. Testing only a cached URL can mask an origin outage.
What to check when content looks old
- Compare the exact URL, method and relevant request headers. Two cache keys may refer to different responses.
- Inspect response
Cache-Control,Age,ETagand any documented edge cache-status fields. Provider-specific statuses should not be generalized to every CDN. - Establish whether the result came from browser cache, CDN edge, proxy or origin. Revalidate or invalidate at the layer that owns the stale copy, with approved production controls.
- For logged-in pages, confirm that private content is not unintentionally stored in a shared cache. A broad cache-everything rule can defeat an application's assumptions.
In practice
Use a CDN for suitable shared assets and measured geographic delivery needs, not as a substitute for a healthy origin, reliable deploys or correct cache headers. Learn Browser cache to distinguish local reuse, Reverse proxy to understand upstream routing, and Latency vs bandwidth for a deliberately bounded timing model.
Sources & model boundaries
Primary references used for this explanation. The example above is illustrative; it is not a live check.
- RFC 9111 — HTTP Caching
Sections 3–5. Caching eligibility, validation, freshness and Cache-Control directives.
Checked .
- Cloudflare — Default Cache Behavior
Default cache behavior, edge TTL and request collapsing. Concrete CDN cache eligibility, origin fetch and variation by edge rules.
Checked .
- Cloudflare — Revalidation
Conditional requests and stale revalidation. CDN revalidation behavior is distinct from browser cache behavior.
Checked .