All services / Performance / CDN & Caching
🚀
Performance

CDN & Caching

CachecacheStoring copies of content so it can be served quickly without fetching or recomputing it every time. your site at the edgethe edge“The edge” means Cloudflare's servers spread across the world, close to your users — as opposed to one central data center. in 330+ cities so visitors get instant loads while your originoriginYour own web server or host where your website actually lives. Cloudflare sits in front of it. does far less work.

What it is

Cloudflare's global CDNCDNContent Delivery Network — a worldwide set of servers that keep copies of your content close to users so pages load faster. caches your content in data centers across 330+ cities. Static assets are delivered from the location closest to each visitor in milliseconds, instead of traveling back to your originoriginYour own web server or host where your website actually lives. Cloudflare sits in front of it. on every request. Cache Rules give you precise control over what is cachedcacheStoring copies of content so it can be served quickly without fetching or recomputing it every time. and for how long.

Why it helps the client

  • Faster page loads worldwide — content is served from the edge, not one origin region.
  • Massive origin offload — cached responses never touch your servers, cutting compute and egress bills.
  • Resilience — Always Online can keep serving pages even when your origin is down.
  • Fine-grained control — Cache Rules decide exactly what to cache and for how long.

Why they'd want it

  • Instant global performance without re-architecting anything.
  • Lower infrastructure costs from dramatically reduced origin traffic.
  • One-click purge and rule-based caching — no code changes required.

🔬 How it actually works

  • The CDNCDNContent Delivery Network — a worldwide set of servers that keep copies of your content close to users so pages load faster. is pull-based: the first request for an asset in a region is a cachecacheStoring copies of content so it can be served quickly without fetching or recomputing it every time. MISS and is fetched from your originoriginYour own web server or host where your website actually lives. Cloudflare sits in front of it., then stored at that data center. Every later request in that region is a HIT served from the edgethe edge“The edge” means Cloudflare's servers spread across the world, close to your users — as opposed to one central data center. in milliseconds. The cache key defaults to the URL but can include query string, cookies, or device type.
  • Cacheability is driven by response headers (Cache-Control, Expires) plus Cloudflare's defaults — static file extensions are cachedcacheStoring copies of content so it can be served quickly without fetching or recomputing it every time. automatically, HTML is not cached by default. Cache Rules (the modern replacement for Page Rules) override this: set Edgethe edge“The edge” means Cloudflare's servers spread across the world, close to your users — as opposed to one central data center. TTLTTLTime To Live — how long cached content is kept before it's refreshed., cache by status code, ignore query strings, or cache normally-dynamic content.
  • Tiered CacheTiered CacheOrganizing Cloudflare data centers into layers so fewer requests ever reach your origin. inserts an upper-tier data center between the lower tier (near the user) and your originoriginYour own web server or host where your website actually lives. Cloudflare sits in front of it., so a miss in one region can be filled from another Cloudflare tier instead of hitting your origin — raising hit ratio and shielding origin.
  • Purge is near-instant across all 330+ cities. You can purge everything, by single URL, by prefix or hostname, or by cachecacheStoring copies of content so it can be served quickly without fetching or recomputing it every time.-tag (prefix/tag purge is Enterprise) — so a deploy refreshes the global cache in seconds without waiting for TTLs.

📖 Key terms on this page hover any underlined term anywhere on the site for its definition

the edge
“The edge” means Cloudflare's servers spread across the world, close to your users — as opposed to one central data center.
origin
Your own web server or host where your website actually lives. Cloudflare sits in front of it.
CDN
Content Delivery Network — a worldwide set of servers that keep copies of your content close to users so pages load faster.
origin offload
Reducing how much traffic reaches your origin by serving it from Cloudflare's cache/edge instead.
Always Online
A Cloudflare feature that serves a cached copy of your site if your origin server goes down.
cache
Storing copies of content so it can be served quickly without fetching or recomputing it every time.
DNS
Domain Name System — the Internet's phone book, translating a domain name (example.com) into a server address.
cache hit ratio
The percentage of requests served straight from cache — higher means more work kept off your origin.
TTL
Time To Live — how long cached content is kept before it's refreshed.
Tiered Cache
Organizing Cloudflare data centers into layers so fewer requests ever reach your origin.
WAF
Web Application Firewall — inspects web requests and blocks malicious ones (like SQL injection and XSS) before they reach your site.
DDoS
Distributed Denial of Service — an attack that floods a site with junk traffic from many sources to knock it offline.
bot
Automated software making requests instead of a human. Some bots are good (search engines); many are malicious.
egress
Data leaving a provider's network. Many clouds charge “egress fees” for it; Cloudflare's R2 has none.
Argo
Cloudflare's smart-routing product that sends traffic over the fastest paths on our private backbone.
API
Application Programming Interface — how software talks to other software, e.g. a mobile app calling a server.

Live demo walkthrough

6 steps

Screens below are annotated recreations of the Cloudflare dashboard. The numbered orange pin marks exactly where to click.

1

Select the website

👆 Account Home → example.com
🔒dash.cloudflare.com
example.com
Test Account NickN

👉 Do this

From the account home, click the site you want to configure.

💬 Say this

“Everything in Cloudflare is organized per website. I'll open our demo site, example.com — notice it's already Active and proxied through Cloudflare.”

2

Open Caching → Configuration

👆 Left nav → Caching → Configuration
🔒dash.cloudflare.com/example.com/caching/configuration
example.com
Test Account NickN

Caching

Configuration

Purge Cache
Purge cached contentRemove files from Cloudflare's cache to serve fresh content.
Caching LevelDetermines how much of your site is cached.
Standard
Browser Cache TTLHow long browsers keep cached files.
4 hours
Always Online™Serve a cached version if your origin is down.

👉 Do this

In the left sidebar, expand Caching and click Configuration.

💬 Say this

“The moment your DNS points at Cloudflare, static content is already cached globally. This screen is where we control how it's stored and served from the edge.”

3

Purge the cache on demand

👆 Caching → Configuration → Purge Everything
🔒dash.cloudflare.com/example.com/caching/configuration
example.com
Test Account NickN

Caching

Configuration

Purge Cache
Purge cached contentRemove files from Cloudflare's cache to serve fresh content.
Caching LevelDetermines how much of your site is cached.
Standard
Browser Cache TTLHow long browsers keep cached files.
4 hours
Always Online™Serve a cached version if your origin is down.

👉 Do this

Click 'Purge Everything' (or use 'Custom Purge' for a single URL).

💬 Say this

“When you ship new content, one click refreshes our entire global cache in seconds — no waiting for TTLs to expire. You can also purge a single URL surgically.”

4

Create a Cache Rule

👆 Left nav → Caching → Cache Rules → Create rule
🔒dash.cloudflare.com/example.com/caching/cache-rules
example.com
Test Account NickN

Caching

Cache Rules

Rule nameExpressionCache eligibilityStatus
Cache all static assetsURI Path contains "/assets/"Eligible – Edge TTL 7dActive
Bypass /apiURI Path starts with "/api"Bypass cacheActive

👉 Do this

Open Cache Rules and click 'Create rule'.

💬 Say this

“Cache Rules let us cache exactly what we want — for example, cache everything under /assets for 7 days, but always bypass /api. This is where we squeeze the maximum offload off the origin.”

5

Prove the results

👆 Left nav → Analytics & Logs
🔒dash.cloudflare.com/example.com
example.com
Test Account NickN

example.com

Enterprise plan · Active

Total requests (24h)48.2M+12%
Data served3.1 TB+8%
Unique visitors912K+5%
Threats blocked1.24M+3%
Traffic served over time

👉 Do this

Open Analytics & Logs to show cache hit ratio and bandwidth saved.

💬 Say this

“Here's the proof: cache hit ratio and bandwidth served from Cloudflare. Customers routinely see 60–90% of their traffic served entirely from our edge — that's traffic their origin never has to pay for.”

6

Read the cache hit ratio

👆 Analytics & Logs → Caching
🔒dash.cloudflare.com/example.com/analytics/caching
example.com
Test Account NickN

Caching

Analytics

Last 24 hours ▾
Cache performance
Cache hit ratio87.4%+4.1%
Requests cached42.1M
Bandwidth saved2.7 TB+9%
Origin requests6.1M-38%
Cached 87%Origin 13%
6
Requests by cache status
hit
miss
expired
dynamic

👉 Do this

Open the caching analytics and point to the hit ratio and origin offload.

💬 Say this

“This is the number that pays for the whole platform: 87% of requests served from our edge, origin requests down 38%, terabytes of bandwidth their servers never had to push. That's the slide the CFO remembers.”

Questions clients ask

Tap a question to reveal the answer to say
Will caching serve stale or wrong content to our users?
No — you control it. Static assets use TTLs; when you deploy you either version filenames or one-click purge, which clears the global cachecacheStoring copies of content so it can be served quickly without fetching or recomputing it every time. in seconds. Personalized responses (Set-Cookie, /apiAPIApplication Programming Interface — how software talks to other software, e.g. a mobile app calling a server., logged-in HTML) are bypassed by default, so users never get someone else's data.
We already have a CDN, or it's built into our cloud. Why change?
Model and integration. CachingcacheStoring copies of content so it can be served quickly without fetching or recomputing it every time. runs in 330+ cities — usually closer to users than a regional edgethe edge“The edge” means Cloudflare's servers spread across the world, close to your users — as opposed to one central data center. — and it's the same platform as your WAFWAFWeb Application Firewall — inspects web requests and blocks malicious ones (like SQL injection and XSS) before they reach your site., DDoSDDoSDistributed Denial of Service — an attack that floods a site with junk traffic from many sources to knock it offline., botsbotAutomated software making requests instead of a human. Some bots are good (search engines); many are malicious., and DNSDNSDomain Name System — the Internet's phone book, translating a domain name (example.com) into a server address.: one control plane, one bill, no egress feesegressData leaving a provider's network. Many clouds charge “egress fees” for it; Cloudflare's R2 has none.. And you don't have to cut over at once; we run in front of your existing setup.
How much origin offload can we realistically expect?
Static-heavy sites commonly serve 60–90% of requests from cachecacheStoring copies of content so it can be served quickly without fetching or recomputing it every time.. Even APIAPIApplication Programming Interface — how software talks to other software, e.g. a mobile app calling a server.-heavy apps gain from Tiered CacheTiered CacheOrganizing Cloudflare data centers into layers so fewer requests ever reach your origin. and ArgoArgoCloudflare's smart-routing product that sends traffic over the fastest paths on our private backbone.. We can enable Analytics and show your real cache hit ratiocache hit ratioThe percentage of requests served straight from cache — higher means more work kept off your origin. on day one.
Does this work with our dynamic app or single-page app?
Yes. JS/CSS/image bundles cachecacheStoring copies of content so it can be served quickly without fetching or recomputing it every time. automatically; for APIsAPIApplication Programming Interface — how software talks to other software, e.g. a mobile app calling a server. you selectively cache safe GETs with Cache Rules or leave them bypassed. The SPA gets instant asset loads while data stays live.
Could caching accidentally expose private data publicly?
No — we never cachecacheStoring copies of content so it can be served quickly without fetching or recomputing it every time. responses with Set-Cookie or auth by default, and Cache Rules let you explicitly bypass sensitive paths or vary the cache by cookie/header where needed.