Documentation Schedule a pilot

CDN and Caching

The Cloudflare CDN caches content in Cloudflare data centres and serves it to clients from the location selected by anycast routing. This page documents the cache decision path, the Cache Rules configuration model, purge behaviour, documented limits and plan availability.

Document control

Dana, technical writer at Integrity
Dana
Technical writer, Integrity Czech Republic s.r.o.

Document control. Vendor: Cloudflare, Inc. Document owner: Dana, technical writer, Integrity Czech Republic s.r.o. Last reviewed: 2026-08-31. Content snapshot of the referenced Cloudflare documentation: 2026-08-28. Figures in this document were verified against the sources listed under References on the dates shown there; Cloudflare changes limits and packaging without notice, so verify at the source before you design against a value.

Overview

A content delivery network stores copies of content at locations near clients and serves requests from those copies, reducing round-trip distance and reducing the number of requests that reach the origin server. The effect on page load time depends on the proportion of requests that can be served from cache and on the size and dependency structure of the page.

Cloudflare states that its network operates in 348 cities and that it is within 50 ms of 95 percent of the internet-connected population (https://www.cloudflare.com/network/, retrieved 2026-08-28). That is a network reach figure, not a guarantee for a specific client population.

The Cloudflare CDN shares its data path with TLS termination, the WAF, DDoS mitigation and Workers. A request is handled once at the edge and is subject to all configured controls in a defined order, which removes the need to chain separate delivery and security intermediaries.

Architecture

Anycast routing directs a client to a nearby Cloudflare data centre. TLS terminates there, the security phases execute, and the cache decision is then made.

The cache decision proceeds as follows:

  1. Determine cache eligibility. By default Cloudflare caches a defined set of static file extensions and does not cache HTML. Cache Rules override this.
  2. Compute the cache key. The default key includes the host, scheme, path and query string, and can be modified with custom cache keys where the plan permits.
  3. Look up the object in the local cache. On a hit, serve it and record the freshness state.
  4. On a miss, with Tiered Cache enabled, request the object from an upper-tier data centre before contacting the origin. Without Tiered Cache, contact the origin directly.
  5. On an origin response, apply the configured edge TTL and browser TTL, then store the object if it is cacheable.

Tiered Cache creates a hierarchy so that origin fetches are consolidated. An object fetched once by an upper tier can serve subsequent misses from lower tiers, which reduces origin request volume and improves hit ratio for long-tail content. Cache Reserve, an add-on backed by R2, adds a persistent storage layer for objects that would otherwise be evicted.

Uncacheable traffic still transits the same path: TLS terminates near the client, connections to the origin are reused, and Argo Smart Routing, where enabled, selects a middle-mile path based on Cloudflare's measurements rather than default routing.

Capabilities

CapabilityBehaviourPlan or tierSource
Default static cachingCaches a defined set of file extensions and honours origin cache-control headers.All plans.Default cache behaviour
Cache RulesExpression-based control over cache eligibility, edge TTL, browser TTL, cache key and cache bypass conditions, including bypass on cookie.All plans; rule quotas differ by plan.Cache Rules
Tiered CacheRoutes cache misses through upper-tier data centres to consolidate origin fetches.Smart Tiered Cache availability differs by plan; verify at source.Tiered Cache
Cache ReservePersistent object storage layer backed by R2 for long-tail content, billed by usage.Add-on.Cache Reserve
PurgePurge by single file, tag, hostname, prefix or everything.All purge methods available on Free, Pro, Business and Enterprise; rate limits differ by plan.Purge cache
Argo Smart RoutingSelects middle-mile paths using Cloudflare network measurements. Usage billed.Add-on.Argo Smart Routing
Protocol supportHTTP/2, HTTP/3 over QUIC, 0-RTT, Brotli and gzip compression at the edge.All plans; some settings are plan gated.Protocol optimisation
Image handlingPolish for recompression and format conversion; Images for transformations and resizing.Polish on Pro and above; Images is a separate billed product.Cloudflare Images
Always OnlineServes an archived copy of pages when the origin is unreachable.Available across plans; behaviour and archive source differ.Always Online

Configuration model

Cache behaviour is configured with Cache Rules in the ruleset engine. A Cache Rule has an expression and a set of cache settings. The settings that most commonly matter are:

Page Rules are the legacy mechanism. Cache behaviour that was previously configured with Page Rules, including bypass cache on cookie, is now expressed with Cache Rules. New configuration should use Cache Rules, and existing Page Rules should be migrated (https://developers.cloudflare.com/rules/reference/page-rules-migration/, retrieved 2026-08-28).

The origin remains authoritative for cacheability unless a rule overrides it. Cache-Control, Vary, Set-Cookie and status code all affect whether a response is stored. A response carrying Set-Cookie is not cached by default, which is the usual reason HTML caching appears not to work on a session-bearing application.

Cache tags are set by the origin in a Cache-Tag response header and are the basis for tag-based purge. Plan the tag scheme before enabling HTML caching, because retrofitting tags requires an origin change.

Limits and constraints

Purge rate limits from https://developers.cloudflare.com/cache/how-to/purge-cache/, verified 2026-08-31. These limits are applied per account and are shared across zones on the same plan tier.

Purge type and metricFreeProBusinessEnterprise
By tag, hostname, prefix or everything: rate5 per minute5 per second10 per second50 per second
By tag, hostname, prefix or everything: maximum operations per request100100100100
By single file: rate800 URLs per second1,500 URLs per second1,500 URLs per second3,000 URLs per second
By single file: maximum URLs per request100100100500

The per-second URL thresholds are calculated as a moving average. The higher per-request allowance on Enterprise applies to single-file purge only; the maximum operations per request for tag, hostname, prefix and purge-everything is 100 on every plan, including Enterprise.

Further constraints:

Plan availability

PlanIncluded
FreeCDN caching, Cache Rules, all purge methods at the lowest rate limits, HTTP/2 and HTTP/3, compression.
ProAdds Polish image optimisation and higher rule and purge allowances.
BusinessAdds custom SSL certificate options and higher allowances.
EnterpriseAdds custom cache keys, the highest purge rate limits, higher cacheable file size, and contractual support terms.
Add-onsArgo Smart Routing and Cache Reserve are billed by usage and can be enabled independently of the zone plan tier.

Accurate as of 2026-08-28 against Cloudflare public documentation and the published terms of service. Packaging and terms change without notice. Confirm at https://developers.cloudflare.com/cache/, https://www.cloudflare.com/plans/ and https://www.cloudflare.com/terms/.

Deployment

Prerequisites.

Staged validation. Apply the intended Cache Rules to a non-production hostname or to a limited path prefix first. Verify cache status headers on responses, confirm that authenticated responses are bypassed, and confirm that no response containing personalised content is stored.

Configuration.

  1. Enable Tiered Cache.
  2. Write Cache Rules for static assets with long edge TTLs, relying on versioned filenames for invalidation.
  3. Write a Cache Rule for anonymous HTML that bypasses cache when the session cookie is present, and set a conservative edge TTL.
  4. Set the cache key explicitly for paths where query parameters are used for tracking rather than content selection, removing those parameters from the key.
  5. Add Cache-Tag headers at the origin for content groups that will need targeted purge.
  6. Configure serve-stale settings and, where appropriate, Always Online, so that origin failure has a defined behaviour.
  7. Integrate purge into the deployment pipeline: purge by tag or by URL after a release, and reserve purge-everything for exceptional cases.

Cutover. Widen the Cache Rules from the validation scope to full production in stages, starting with static assets, then anonymous HTML for a subset of paths, then the remainder. Leave one business cycle between stages.

Verification.

Rollback. Disable the affected Cache Rule and purge the paths it covered. Because a rollback does not remove already-served responses from downstream caches, keep browser TTLs short during initial rollout so that an error has a bounded lifetime in client caches.

Operational considerations

Monitor cache hit ratio, origin request rate and origin error rate together. A hit ratio that falls without a configuration change usually indicates increased cache key cardinality, new query parameters from a marketing campaign, or a change in origin response headers.

Treat Set-Cookie on a cacheable response as an incident condition. It usually indicates that a session is being created on a page intended to be anonymous, and it will suppress caching or, if overridden, risk cross-user content exposure.

Keep purge operations within the documented rate limits and design the pipeline to purge by tag rather than by enumerating URLs, so that release size does not scale purge volume linearly.

Where Logpush is available, export cache status fields with request logs so that hit ratio can be analysed by path and by content type rather than at zone level only.

Failure modes to plan for: a new personalisation feature deployed on a cached path, a change to the session cookie name that invalidates the bypass condition, and an origin that begins emitting Cache-Control: no-store after a framework upgrade.

Known caveats

Interoperability

Cache Rules execute in the ruleset engine after the security phases, so a request blocked by the WAF is never cached or served from cache.

Workers can read from and write to the cache through the Cache API and can implement custom cache logic. Where both a Cache Rule and a Worker act on the same request, the documented traffic sequence determines precedence.

Cache Reserve is backed by R2, and R2 can also serve as an origin for the CDN, which allows an object storage backed site with no conventional origin server.

Argo Smart Routing affects only the connection between the Cloudflare edge and the origin, so it changes behaviour for cache misses and uncacheable traffic, not for cache hits.

Cloudflare Images and Stream handle media that self-serve plan terms exclude from general CDN delivery.

FAQ

Can HTML be cached? Yes, using a Cache Rule that makes HTML eligible for cache and bypasses the cache when a session cookie is present. The reliability of the bypass condition determines whether this is safe.

Why is a response not being cached despite a Cache Rule? Check for Set-Cookie on the response, a Cache-Control directive that forbids storage, a Vary header with high cardinality, or a non-cacheable status code. The cache status header on the response identifies the reason.

What is the recommended invalidation strategy for a release? Use versioned filenames for static assets so that no invalidation is required, and purge by cache tag for HTML and other content that keeps a stable URL.

References

Content snapshot: 2026-08-28.

Changelog

DateChangeAuthor
2026-08-31Rewritten as a technical reference. Added limits and plan availability tables with sources.Integrity documentation team
2026-08-28Initial publication.Integrity documentation team

Request your free pilot

Schedule a pilot