Orange Book
CDN and web performance

06 · Understand Cloudflare's default cache behavior

Use request eligibility, file extensions, response headers, default TTLs, and CF-Cache-Status to explain why an object hits or bypasses cache.

Edited and verified by Orange Book Editorial Team ·

CDN · PHASE 2BEGINNERAbout 24 minutesCache-Control · TTL · CF-Cache-Status

Outcome

Without creating a Cache Rule, you can determine whether a request is eligible, whether the response permits shared storage, whether the object exists in the current data center, and how those layers produce DYNAMIC, BYPASS, MISS, or HIT.

Cacheability is not one toggle

flowchart TD
  A[Request reaches Cloudflare] --> B{Is the hostname Proxied?}
  B -- No --> X[Does not enter Cloudflare cache]
  B -- Yes --> C{Is the request eligible?}
  C -- No --> D[DYNAMIC or outside normal cache path]
  C -- Yes --> E{Do extension, rules, and response headers allow storage?}
  E -- No --> F[BYPASS or DYNAMIC]
  E -- Yes --> G{Does this data center have a fresh object?}
  G -- No --> H[MISS, then request the origin]
  G -- Yes --> I[HIT, return cached object]

By default, Cloudflare recognizes common static content from the URL file extension rather than inferring it from the response MIME type. HTML and JSON are not cached by default. Before explicitly caching either, handle identity, cookies, and private responses and then use a narrowly scoped Cache Rule.

Objects you will encounter by default

TypeDefault tendencyExampleImportant boundary
Common static extensionsCacheable.css, .js, .png, .webp, .woff2Method, status, and response headers still apply
HTMLNot cached/, /pricingA URL without a static extension is commonly DYNAMIC
JSONNot cached/api/products.jsonEven public data needs an explicit rule and privacy review
Response with Set-CookieCommonly not storedSign-in, experiment assignment, session setupFirst ask whether the cookie is required
private, no-store, and similarNot stored in shared cacheAccount pages and sensitive APIsDo not remove privacy semantics to chase a hit ratio

Eligibility is evaluated at two points

DYNAMIC commonly means the request was ineligible when it arrived, such as default HTML, a bypass rule, or Development Mode. BYPASS commonly means the request could have entered the cache path, but response headers, cookies, or configuration prevented storage. Always combine the status with the complete response headers and rules.

Default Edge TTL without explicit cache headers

Response statusDefault Edge TTL
200, 206, 301120 minutes
302, 30320 minutes
404, 4103 minutes
Other statusNot cached by default

This table applies only when the object is otherwise eligible and the origin provides no explicit cache headers. Origin Cache-Control, Expires, Cache Rules, and plan capabilities can all change the result.

Test the same URL repeatably

Choose a static object without cookies

Use a fingerprinted asset that a production page actually references, such as /assets/app.a1b2c3.js. Do not start with the homepage, and do not attach a signed-in cookie.

Request it twice and preserve complete headers

curl -sS -D first.headers -o /dev/null \
  https://www.example.com/assets/app.a1b2c3.js
curl -sS -D second.headers -o /dev/null \
  https://www.example.com/assets/app.a1b2c3.js

Compare CF-Cache-Status, Age, Cache-Control, Expires, Set-Cookie, Vary, the status code, and CF-Ray. The same URL can still be a first MISS in another Cloudflare data center, so retain the data-center suffix in the Ray ID.

Explain the status from evidence

A common sequence is the first request returning MISS, followed by a HIT at the same cache location with an increasing Age. For DYNAMIC, inspect extension and Cache Rules first. For BYPASS, inspect Set-Cookie and cache-control headers. Do not purge cache merely because an object did not hit.

Then test a dynamic page

curl -sS -D - -o /dev/null https://www.example.com/account

An account page remaining DYNAMIC or BYPASS is often the correct result. Cache optimization balances correctness, origin load, and latency; it does not turn every URL into a HIT.

Cache-status quick reference

StatusMeaningNext inspection
HITA usable object exists at this cache locationAge, content version, and cache key
MISSEligible request, but no object exists hereRepeat once and check whether it was stored
DYNAMICRequest did not enter normal cache eligibilityExtension, method, rules, Development Mode
BYPASSResponse or configuration prevented storageCache-Control, Expires, Set-Cookie
EXPIREDAn object existed but its TTL elapsedTTL and revalidation result
REVALIDATEDOrigin confirmed the expired object was still validETag or Last-Modified
UPDATINGA stale object is served during asynchronous refreshstale-while-revalidate policy

For deeper diagnosis, use the CF-Cache-Status troubleshooting guide. The next phase applies safe Cache Rules to real applications.

Primary sources

Did this page help you complete your goal?

Beta feedback is generated in this browser and is never uploaded automatically.

On this page