Cf-cache-status: MISS



Hi, I am new to Cloudflare. I set up my domain in Cloudflare yesterday, and I could see my domain is active on Cloudflare.

However, I would like to know if scripts are cached in Cloudflare CDN or not. I used to test a files. I tried several times, unfortunately, it always showed cf-cache-status: MISS.

Could someone please help look into my situation? I would appreciate a lot.
Here is my test result -

Response Headers:

status: 200

cf-cache-status: MISS
x-powered-by: Express
vary: Accept-Encoding
server: cloudflare
last-modified: Fri, 21 Sep 2018 09:10:27 GMT
etag: W/“464-165fb6507b8”
cache-control: public, max-age=14400


Here is the details

- Request 1:

Error/Status Code: 200
Priority: HIGHEST
Protocol: HTTP/2
HTTP/2 Stream: 1, weight 256, depends on 0, EXCLUSIVE
Client Port: 48700
Request Start: 0.155 s
Initial Connection: 34 ms
Time to First Byte: 60 ms
Content Download: 5 ms
Bytes In (downloaded): 0.9 KB
Uncompressed Size: 1.1 KB
Bytes Out (uploaded): 0.4 KB

Request Headers:

:path: /javascripts/index.js
accept-language: en-US,en;q=0.9
accept-encoding: gzip, deflate, br
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 PTST/180920.120941
:scheme: https
upgrade-insecure-requests: 1
:method: GET

Response Headers:

status: 200
expect-ct: max-age=604800, report-uri=“
expires: Fri, 21 Sep 2018 19:06:25 GMT
content-encoding: br
set-cookie: __cfduid=dde5c48e01e234c7bb62e59702ec19ad01537542385; expires=Sat, 21-Sep-19 15:06:25 GMT; path=/;; HttpOnly
cf-cache-status: MISS
x-powered-by: Express
vary: Accept-Encoding
server: cloudflare
last-modified: Fri, 21 Sep 2018 09:10:27 GMT
etag: W/“464-165fb6507b8”
cache-control: public, max-age=14400
date: Fri, 21 Sep 2018 15:06:25 GMT
cf-ray: 45dd6f832c14c1cc-IAD
content-type: application/javascript


It looks good to me, but I can confirm that I’m only getting MISS for that resource.

It’s possible there’s a header your server is sending that’s telling Cloudflare to not cache that resource.

Can you try:
curl -svo /dev/null --header “Host: example.comhttp:// javascripts/index.js (but use your server’s actual IP address).

You might have to resort to:
curl -svo /dev/null --resolve javascripts/index.js

And then post that header. It’s ok to delete the actual IP address when you post the header.


Hi, sdayman:
Many thanks for your message! Indeed, I tried to test several of my website’s resource, they were all MISS for cf-cache-status.

I followed your instructions, here is the result for your first suggestion. I appreciated your assistance!

curl -k -svo /dev/null --header “” https:///javascripts/index.js

  • Trying xx.xx.xx.xx…

  • Connected to (xx.xx.xx.xx) port 443 (#0)

  • TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256

  • Server certificate: *

  • Server certificate: Amazon

  • Server certificate: Amazon Root CA 1

  • Server certificate: Starfield Services Root Certificate Authority - G2

GET /javascripts/index.js HTTP/1.1

User-Agent: curl/7.43.0

Accept: /

< HTTP/1.1 200 OK

< Date: Sat, 22 Sep 2018 02:00:35 GMT

< Content-Type: application/javascript

< Content-Length: 1124

< Connection: keep-alive

< Server: nginx/1.12.1

< X-Powered-By: Express

< Accept-Ranges: bytes

< Cache-Control: public, max-age=0

< Last-Modified: Fri, 21 Sep 2018 09:10:27 GMT

< ETag: W/“464-165fb6507b8”

< set-cookie: connect.sid=s%3Aa6a86c1b-d6bd-4f17-bc36-58a3884f0544.ztxMrv96fVKoXv9AZuhoNfnJf0uzg9N1%2FFTMbyW7o7o; Path=/; Expires=Mon, 23 Sep 2019 02:00:35 GMT; HttpOnly


{ [1124 bytes data]

  • Connection #0 to host left intact


Cache-Control: public, max-age=0

This is probably what’s causing the MISS.


Hi, sdayman:
Here is my result for your second suggestion, it showed HIT for cf-cache-status. But why was the response “HTTP/1.1 404 Not Found”

curl -svo /dev/null --resolve

  • Added to DNS cache

  • Trying xx.xx.xx.xx…

  • Connected to (xx.xx.xx.xx) port 443 (#0)

  • TLS 1.2 connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256

  • Server certificate:

  • Server certificate: CloudFlare Inc ECC CA-2

  • Server certificate: Baltimore CyberTrust Root

GET /javascrips/index.js HTTP/1.1


User-Agent: curl/7.43.0

Accept: /

< HTTP/1.1 404 Not Found

< Date: Sat, 22 Sep 2018 02:17:12 GMT

< Content-Type: text/html; charset=utf-8

< Transfer-Encoding: chunked

< Connection: keep-alive

< Set-Cookie: __cfduid=d0edc86b3dfe35c4687583dcbd1f8ec6a1537582632; expires=Sun, 22-Sep-19 02:17:12 GMT; path=/;; HttpOnly

< X-Powered-By: Express

< CF-Cache-Status: HIT

< Expires: Sat, 22 Sep 2018 06:17:12 GMT

< Cache-Control: public, max-age=14400

< Expect-CT: max-age=604800, report-uri=“

< Server: cloudflare

< CF-RAY: 45e1461f4b2999a3-LAX


{ [800 bytes data]


Hi, sdayman:
I tried the previous command again,
curl -svo /dev/null
, it was still a cache miss.

What is the difference between above command and the command you suggested,
curl -svo /dev/null --resolve

I appreciated you help very much!


Those were just a couple of recommended ways to use Curl. It looks like your first attempt got the information I was looking for: the Cache-Control header. Your server is telling Cloudflare it’s a max-age of 0, which makes Cloudflare not cache that resource.


Check that the site’s .htaccess isn’t overriding Cloudflare’s caching.
Also try adding a page rule in Cloudflare that says “Cache everything”


Hi, sdayman:
Many thanks for your findings, I would figure out how to fix it.

Best regards,
Shih-Chin Yang


Hi, holtslander:
Many thanks for your suggestions. My server is written in Node.js with Express framework, and hosted in AWS.


Hi, sdayman:
My server is running by node.js with express framework. After I used express-cache-controller to set maxAge to a non-zero value, I started to see HIT in cf-cache-status for my requests.

Many thanks for your assistance in figuring out the issue.
Best regards,



This topic was automatically closed after 31 days. New replies are no longer allowed.