Skip to content

cf-cache-status: DYNAMIC, BYPASS, MISS and HIT explained

cf-cache-status tells you what Cloudflare's cache did with a response. See what DYNAMIC, BYPASS, MISS and HIT mean, and the one check each value calls for.

cf-cache-status is the header Cloudflare adds to every proxied response to say what its cache did with it. The quickest way to read it is to ask who decided: did Cloudflare cache this, and if not, was that Cloudflare’s default behaviour, a rule you wrote, or a header your origin sent? DYNAMIC confuses people most, and it is the least alarming. It means Cloudflare never considered the URL cacheable, which is the normal answer for an HTML page. BYPASS is different: the response was eligible, and something actively said no. MISS is different again: the URL was eligible but was not yet stored in that data centre. HIT means the response came from Cloudflare’s cache. Each value below leads to one specific next check.

What you’ll accomplish

  • Read cf-cache-status on any URL and say which of the three decision-makers — Cloudflare’s defaults, your Cache Rules, or your origin’s headers — produced the value you see.
  • Tell DYNAMIC, BYPASS and MISS apart from a single response, and stop treating DYNAMIC on an HTML page as a fault.
  • Prove why a MISS never turns into a HIT, and name the cause: origin Cache-Control, a Set-Cookie, a Vary, or a query string fragmenting the cache key.
  • Measure honestly, by reading cf-ray to see which data centre answered before you compare two results.
  • Cache a WordPress site’s anonymous HTML while keeping logged-in requests out of cache, and verify both halves from the command line.

Prerequisites

  • curl 7.x or 8.x. Everything here uses -s, -I, -D, -H and --resolve, all of which have shipped for many years. Check with curl --version.
  • A hostname proxied through Cloudflare — the orange cloud in DNS. A grey-cloud (DNS-only) record never touches the cache and carries no such header at all. That absence is itself a finding, not a broken test.
  • Access to the Cloudflare dashboard under Caching → Cache Rules if you intend to change anything. Cache Rules are available on all plans; Page Rules still exist on older zones and do the same job with less precision.
  • Two habits. Over HTTP/2 and HTTP/3 all header names are lowercase, so every grep here uses -i. And curl -I sends a HEAD request — a few origins answer HEAD differently from GET, so when a result surprises you, repeat it with curl -s -o /dev/null -D - <url>.

How it works

The edge asks a fixed series of questions about one request, in one data centre, and the first question that produces a terminal answer becomes the value of cf-cache-status. Reading the header is really reading which question the request fell out at.

Decision path a Cloudflare data centre follows for one request, from cache eligibility through explicit bypass, presence in that colo and Edge TTL freshness, with each outcome labelled with the cf-cache-status value it produces: DYNAMIC, BYPASS, MISS, HIT, EXPIRED, REVALIDATED and STALE

The first question is eligibility, and it is where most confusion lives. Cloudflare’s default cache policy is extension-driven: it caches a fixed set of static file types — CSS, JavaScript, images, fonts, archives, media — and treats everything else, including HTML and every extension-less URL, as not cacheable. Not cacheable is reported as DYNAMIC. Nothing has gone wrong; you simply have not told Cloudflare to cache your pages, and it will not guess. That is why curl against your homepage returns DYNAMIC on a stock configuration, and why that is the correct result rather than a bug report.

The second question is whether something explicitly refused. Refusals come from three places: a Cache Rule of yours with the eligibility set to bypass, a Set-Cookie on the response, or a Cache-Control on the response containing no-store or private. Any of those turns an eligible response into BYPASS. The distinction from DYNAMIC matters because the fixes are in opposite directions — DYNAMIC means you need to grant permission, BYPASS means you need to find and withdraw a refusal.

The third question is presence. If the response is eligible and nobody refused, the edge looks in this data centre’s store. Not there means MISS: the edge fetches from your origin, serves the response, and stores it. A MISS is only a problem when it never becomes a HIT.

The fourth question is freshness. A stored copy carries an Edge TTL, and the age header on a HIT tells you how many seconds the copy has been sitting there. Within TTL, you get HIT. Past TTL, Cloudflare revalidates with your origin, and the result of that conversation is one of three values: EXPIRED if the origin returned a fresh body, REVALIDATED if the origin answered 304 Not Modified and the stored copy was served as-is, or STALE if the revalidation did not complete in time and Cloudflare served the expired copy rather than nothing. UPDATING is a near relative of STALE: a still-valid copy served while a refresh runs in the background.

The detail that makes all of this measurable is that every one of these answers is per data centre, and each of Cloudflare’s hundreds of them keeps its own store. A colleague reporting HIT while you get MISS is not a contradiction; you were talking to two different machines in two different cities. The full status list is in the Cloudflare cache documentation.

Step-by-step

1. Read the header, and read it twice. One sample tells you nothing about a cache. Two consecutive samples of the same URL tell you whether the entry survives.

curl -sI https://example.com/assets/app.css | grep -iE '^(HTTP|cf-cache-status|cf-ray|age|cache-control)'
curl -sI https://example.com/assets/app.css | grep -iE '^(HTTP|cf-cache-status|cf-ray|age|cache-control)'
HTTP/2 200
cache-control: public, max-age=14400
cf-cache-status: MISS
cf-ray: 8f3c1a2b4d5e6789-YUL

HTTP/2 200
cache-control: public, max-age=14400
age: 4
cf-cache-status: HIT
cf-ray: 8f3c1a2c9b117a30-YUL

MISS then HIT, with an age appearing on the second response, is a cache filling correctly. That is the shape you are looking for on every asset you expect to be cached.

2. Check which data centre answered before you compare anything. The three-letter suffix on cf-ray is the IATA code of the data centre that handled the request — YUL for Montréal, CDG for Paris. Both samples above ended in -YUL, so the comparison is valid.

curl -sI https://example.com/ | grep -i '^cf-ray' | awk -F- '{print $NF}'
YUL

If two consecutive requests come back from different codes, discard the comparison and run it again. You cannot choose a data centre from curl; you can only check which one you got. The full anatomy of the header is in reading cf-ray response headers.

3. Diagnose DYNAMIC by asking what would have made it eligible. Run the same read against an HTML page rather than an asset:

curl -sI https://example.com/ | grep -iE '^(content-type|cf-cache-status|cf-ray)'
content-type: text/html; charset=UTF-8
cf-cache-status: DYNAMIC
cf-ray: 8f3c1b0e2a4c118d-YUL

Two questions settle it. Does the URL end in an extension from Cloudflare’s default cacheable set? An HTML page or a pretty permalink does not, so the default answer is no. Is there a Cache Rule that marks the path eligible? On a stock zone there is not. Both answers being no is exactly what produces DYNAMIC, and the header is reporting configuration, not failure. If a .css or .png URL returns DYNAMIC, that is worth investigating — check for a Cache Rule with the eligibility set to bypass, and check that the file is really being served under that extension rather than through a rewriting handler.

4. Separate BYPASS from DYNAMIC by looking for the refusal. BYPASS always has an instruction behind it, and there are only three places to look. Ask for all of them at once:

curl -sI https://example.com/cart/ | grep -iE '^(cf-cache-status|cache-control|set-cookie|vary|pragma)'
cache-control: no-store, no-cache, must-revalidate, max-age=0
set-cookie: PHPSESSID=8b21c0f4e7; path=/; HttpOnly
cf-cache-status: BYPASS

Two independent refusals are visible: the origin’s Cache-Control: no-store and a session cookie on the response. Fix these at the origin. Overriding them with a Cache Rule while the origin still emits a per-user Set-Cookie is how one visitor’s session ends up served to another — far worse than a slow page. Check vary while you are there too: Cloudflare will not cache a response that varies on arbitrary request headers, and a stray Vary: User-Agent or Vary: Cookie from a plugin quietly disables caching for that route.

5. Find out why a MISS never becomes a HIT. Repeat step 1 several times from the same data centre. If you never see HIT, the entry is not being stored, and there are three usual reasons. First, the origin is refusing at the header level, which you confirm by asking the origin directly — bypassing Cloudflare with --resolve against your real origin IP:

curl -sI https://example.com/assets/app.css --resolve example.com:443:203.0.113.10 \
  | grep -iE '^(cache-control|set-cookie|vary|expires|server)'
server: nginx
cache-control: private, max-age=0
expires: Thu, 05 Sep 2026 14:11:03 GMT

That private is the whole answer: the origin is telling every cache in the world not to store this. Change it to public, max-age=... for genuinely public assets.

Second, the URL you are testing carries a query string that changes each time. Cloudflare’s default cache key includes the full query string, so ?v=1757081234 is a different object from ?v=1757081235, and every request is a legitimate first request:

curl -sI "https://example.com/assets/app.css?v=$(date +%s)" | grep -i '^cf-cache-status'
curl -sI "https://example.com/assets/app.css?v=$(date +%s)" | grep -i '^cf-cache-status'
cf-cache-status: MISS
cf-cache-status: MISS

Two MISS results in a row here prove nothing is broken — you asked for two different objects. Re-test without the query string before drawing any conclusion. Where per-request parameters are unavoidable (tracking parameters on shared links, for instance), the durable fix is to stop generating the variance at the source, since custom cache key configuration is not available on every plan.

Third, low traffic: a rarely requested object in a quiet data centre can be evicted between tests. Two MISS results ten minutes apart on a low-traffic site are not conclusive; two ten seconds apart are.

6. Read EXPIRED, REVALIDATED and STALE as three different statements. They only appear once an entry has lived past its Edge TTL, and each says something specific about the conversation with your origin.

curl -sI https://example.com/feed.xml | grep -iE '^(cf-cache-status|age|cache-control|etag|last-modified)'
cache-control: public, max-age=60
etag: "6f1c3a-58e2"
last-modified: Fri, 05 Sep 2026 13:58:44 GMT
age: 0
cf-cache-status: REVALIDATED

REVALIDATED with age: 0 means the copy aged out, Cloudflare asked the origin with If-None-Match or If-Modified-Since, the origin answered 304 Not Modified, and the stored copy was reused — a cheap outcome, since you paid for a round trip but not a body. EXPIRED in the same place means the origin sent a new body instead. Seeing either constantly means your Edge TTL is shorter than the content actually changes; lengthen it and purge on deploy.

STALE is the one to treat as an alarm. It means the copy was past expiry, Cloudflare tried to refresh it, and the origin did not answer in time — so users were served old content instead of an error. That is the cache doing you a favour, and it is also a statement about origin health at that moment, not about your cache settings. Chase origin latency and error rates, not TTLs.

7. Work a real WordPress case. A stock WordPress site behind Cloudflare returns DYNAMIC on every page, because pretty permalinks have no extension and no rule says otherwise; only static assets under /wp-content/ and /wp-includes/ get cached. The goal is anonymous HTML served from the edge, and logged-in or cart traffic never served from it.

Create two Cache Rules under Caching → Cache Rules, and write their expressions so they cannot both match the same request. Rules are evaluated in order and a later match can override an earlier one’s settings; mutually exclusive expressions mean you never have to remember which way that goes.

Rule one, named something like WP — never cache, with Cache eligibility → Bypass cache:

(http.cookie contains "wordpress_logged_in_"
 or http.cookie contains "woocommerce_items_in_cart"
 or http.cookie contains "comment_author_"
 or starts_with(http.request.uri.path, "/wp-admin")
 or http.request.uri.path eq "/wp-login.php")

Rule two, named WP — cache anonymous HTML, with Cache eligibility → Eligible for cache and Edge TTL → Override origin, 2 hours:

(http.host eq "example.com"
 and not (http.cookie contains "wordpress_logged_in_")
 and not (http.cookie contains "woocommerce_items_in_cart")
 and not (http.cookie contains "comment_author_")
 and not starts_with(http.request.uri.path, "/wp-admin")
 and http.request.uri.path ne "/wp-login.php")

Cloudflare does document some automatic cookie-based bypass behaviour for WordPress, but it has changed over the years and it does not know about custom session or membership cookies. Write the bypass rule explicitly and verify it rather than assuming coverage.

Validate it works

Three checks, in this order. First, the anonymous page should now fill the cache — same URL twice, same data centre:

curl -sI https://example.com/ | grep -iE '^(cf-cache-status|cf-ray|age)'
curl -sI https://example.com/ | grep -iE '^(cf-cache-status|cf-ray|age)'
cf-cache-status: MISS
cf-ray: 8f3c1e77a02c4419-YUL

age: 6
cf-cache-status: HIT
cf-ray: 8f3c1e8b31d70c02-YUL

DYNAMIC has become MISS then HIT, and both rays end in the same code. Second, a request that carries the logged-in cookie must not be served from that cache. Simulate it without logging in:

curl -sI https://example.com/ -H 'Cookie: wordpress_logged_in_deadbeef=someuser|1757100000|abc' \
  | grep -iE '^(cf-cache-status|cf-ray)'
cf-cache-status: BYPASS
cf-ray: 8f3c1ea44f81b7c6-YUL

BYPASS, not HIT, is the correct and required answer. If it returns HIT, stop and fix the bypass rule before any real user logs in — a cached logged-in page is served to everyone. Third, confirm the admin path is untouched:

curl -sI https://example.com/wp-admin/ | grep -i '^cf-cache-status'
cf-cache-status: BYPASS

Troubleshooting

The map below is worth keeping next to your terminal: it turns each value into the single thing to check next, which is the whole point of reading the header at all.

Table mapping each cf-cache-status value to what it tells you and the one thing to check next, covering DYNAMIC, BYPASS, MISS, HIT, EXPIRED, REVALIDATED and STALE, with a note that an absent header means a DNS-only hostname or a Worker-generated response

Two people see different statuses for the same URL. Almost always different data centres. Compare the cf-ray suffixes first; if they differ, the results are not comparable. Re-test with both parties reading their own cf-ray, or judge by the aggregate under Analytics → Cache.

HIT with a small age, but users still report old content. The stale copy is in their browser, not at the edge — cf-cache-status reports the edge layer only. Look at Browser TTL and the cache-control: max-age your origin sends, and have the reporter test in a private window before you purge anything.

The cache-everything rule works, and now logged-in users see each other’s pages. The bypass rule is not matching. Check the actual cookie name — WordPress uses wordpress_logged_in_ followed by a hash, so the expression must use contains, not eq. Purge everything immediately, then re-verify with the -H 'Cookie: ...' test from the validation section before restoring the caching rule.

cf-cache-status is missing entirely. Either the hostname is grey-clouded in DNS, in which case nothing in this article applies until you proxy it, or the response was generated by a Worker or a redirect that never entered cache logic. Check for server: cloudflare in the same response — if that is absent too, you are talking to your origin directly.

Everything reads DYNAMIC after you added a Cache Rule. Confirm the rule is enabled, that its expression actually matches (the dashboard shows a match count), and that you are testing the hostname the rule names. A rule scoped to http.host eq "example.com" will not match www.example.com.

When this is the wrong approach

cf-cache-status is a report on one layer. If your page is slow while reading HIT, the cache is working and the weight is elsewhere — render-blocking assets, third-party scripts, a large payload. If content updates do not appear, the fix is a purge strategy, not a header investigation. And if the site is genuinely per-user on every page — a dashboard, a logged-in application, a checkout flow — then DYNAMIC and BYPASS are the correct outcomes throughout, and effort spent forcing them to HIT is effort spent building a security incident. For the rule syntax and TTL mechanics behind step 7, see Cloudflare Cache Rules and cacheability.

If this is the kind of work you’d rather never own again, it’s the daily job of Managed Cloud Ops — book an infrastructure review.