AdminsForum

Cloudflare

Guide Check Cloudflare Cache Status: HIT, MISS and DYNAMIC

Started by MAYA 0 replies 181 views
1MAYA
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
#1
cloudflare cache status adminsforum   
Is Cloudflare actually serving your file from cache? Check the response for the exact asset URL, then request that same URL again. A working proxy does not mean every page is cached.

1. Choose a safe test file
Use an existing public CSS, JavaScript or image file that anyone can download without signing in. Confirm the hostname is proxied in Cloudflare DNS and the final HTTPS URL returns 200. Do not test with a mailbox, dashboard, checkout or personalized page. This walkthrough uses our disposable public CSS fixture, not a live application.

2. Read a GET response
On Linux/macOS or an SSH session:
Code:
curl -sS -D - -o /dev/null https://YOUR-HOST.example/style.css
Replace the example with your actual file URL. -sS hides the progress meter but keeps errors; -D - prints response headers; -o /dev/null discards the downloaded body. This performs a GET, not a HEAD request. In Windows PowerShell use curl.exe and replace /dev/null with NUL.

Check the status line first. If it is 301/302, inspect Location and test the final HTTPS asset URL directly. A login redirect or error page is not proof that your intended file is cached.

3. Repeat without changing the URL
Run the same command a few seconds later. Keep the scheme, hostname, path and query string identical. Adding a random query can select a different cache entry.

Our 19 October 2026 server-side test returned:
Code:
14:42:13 UTC HTTP 200 CF-Cache-Status: MISS 14:42:15 UTC HTTP 200 CF-Cache-Status: HIT Age: 2 14:42:17 UTC HTTP 200 CF-Cache-Status: HIT Age: 4
All three bodies contained our public fixture v1. The Ray IDs ended in SOF. This confirms the observed requests used a cached copy; it does not benchmark global performance or guarantee every visitor reaches a warm cache.

4. Understand the main results
HIT means Cloudflare served a cached object. MISS means the eligible object was not available in that cache and was fetched. DYNAMIC means the request was not cache eligible; BYPASS can indicate an otherwise eligible response was prevented from caching. Age helps show time in cache, but inspect it together with CF-Cache-Status.

5. Investigate an unexpected result
Check the exact URL, DNS proxy state, response status, Cache-Control, Set-Cookie and matching Cache Rules. A DNS-only record goes directly to the origin. Private/no-store responses and personalized content should remain protected. Do not fix a low hit rate by caching authenticated HTML indiscriminately.

Our root control page returned 200, Cache-Control: no-store and DYNAMIC. We retained that behavior. Only /cache-lab.css had an explicit public origin policy. Its origin max-age was 300 seconds, but the client-facing response showed max-age=14400 because the zone Browser Cache TTL was four hours. That header alone does not prove the edge retention time.

Browser check
In your browser developer tools, open Network, reload and select the CSS request. Read Response Headers and distinguish a network response from memory/disk cache. This browser procedure is explanatory; the published evidence came from server-side curl, not a measured browser session.

When the file changes
Verify the origin serves the new version, then purge that exact URL if the edge still has the previous copy. A versioned filename is useful for future asset deployments.

Reference: Cloudflare cache response documentation. The branded animation summarizes our original test results; it is not a continuous screen recording.

Next: Purge one URL and verify the updated file.
Reply
Possibly Related Threads…matched by title
Replies:0Views:250
Replies:0Views:177
Replies:0Views:175
Replies:0Views:174
Replies:0Views:205

Users browsing this thread: 1 Guest(s)
Forum Jump: