Question 5 of 6

Content not Being Cached

Customer ticket

Subject: Content not Being Cached

After activating Cloudflare on my site, I am seeing that resources on my pages are not being cached: […] Why is Cloudflare’s caching not working on my site?
Response headers provided by the customer
< HTTP/1.1 200 OK
< Content-Type: text/html; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0
< Strict-Transport-Security: max-age=10
< Server: cloudflare-nginx
< CF-RAY: 1fa4b922fef517a4-SIN
{ [3507 bytes data]

2. Thought process

I read the headers line by line, since they contain the whole story:

  • Content-Type: text/html means the resource is HTML, which isn’t in Cloudflare’s default cached extensions. The current docs say this explicitly (“does not cache HTML or JSON by default”).
  • Cache-Control: no-store, no-cache, …, max-age=0 means the origin forbids caching. According to the docs, no-store prevents caching in either Origin Cache Control mode, so even “Eligible for cache” gives BYPASS unless the Edge TTL overrides origin headers.
  • No CF-Cache-Status plus Server: cloudflare-nginx: modern responses show DYNAMIC for uncached HTML and server: cloudflare, so this capture is likely old. I ask for fresh output rather than assume.
  • CF-RAY …-SIN means it was served from Singapore. That’s worth checking against where the customer tested from, but I keep it to a light question.
  • HSTS max-age=10 is a side observation. It isn’t the question, but it’s worth a friendly mention.

The customer said “resources on my pages” but showed only the HTML document, so I separate the two: static assets are probably fine (and I show how to check), while HTML needs an explicit opt-in. I steer them to Cache Rules rather than Page Rules, since Page Rules are now marked as deprecated in the docs, and I warn about caching personalised pages. That’s the real risk with “cache everything”.

3. Tools I would use, and why

ToolWhy
curl -svo /dev/null <url>Shows the response headers (cf-cache-status, cache-control, age, set-cookie) for both HTML and static assets.
Browser DevTools > NetworkLets the customer see cache status for every resource on the page at once.
Cloudflare dashboard: Caching > Cache RulesMake HTML eligible for cache and override the origin TTL safely, with exclusions.
Cloudflare dashboard: Caching > ConfigurationCheck Development Mode and caching level, and purge after changes.
Cloudflare Trace (Rules > Trace)Confirms which Cache Rule matches a given URL.
Analytics > Caching / Cache AnalyticsShows cache hit ratio and which content types are served dynamically, before and after the change.
Origin config (e.g. nginx, Apache, CMS)Where the no-store header comes from, and the long-term fix.