Skip to content
WebsiteHosting.com

concept Delivery & performance

CDN

Understand how a CDN serves nearby edge responses, when it contacts origin, and why not all content is cached.

Sources checked · P0025

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 conditionWhat can happen
Fresh cached imageEdge returns stored bytes without an origin fetch
No usable stored responseEdge requests the origin and may cache an eligible response
Personalized or excluded responseEdge forwards to origin or handles it without normal cache reuse
Visitor --> CDN edge --> [cached object?]
                          | yes: return stored response
                          + no: origin request --> response

The 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

  1. Compare the exact URL, method and relevant request headers. Two cache keys may refer to different responses.
  2. Inspect response Cache-Control, Age, ETag and any documented edge cache-status fields. Provider-specific statuses should not be generalized to every CDN.
  3. 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.
  4. 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.

  1. RFC 9111 — HTTP Caching

    Sections 3–5. Caching eligibility, validation, freshness and Cache-Control directives.

    Checked .

  2. Cloudflare — Default Cache Behavior

    Default cache behavior, edge TTL and request collapsing. Concrete CDN cache eligibility, origin fetch and variation by edge rules.

    Checked .

  3. Cloudflare — Revalidation

    Conditional requests and stale revalidation. CDN revalidation behavior is distinct from browser cache behavior.

    Checked .