Javascript files never get cached. 'cf-cache-status: MISS'


I am pretty sure I am just unclear on how Cloudflare caching is suppose to work. Hoping someone can clarify / help me out.

I recently configured Cloudflare on a domain of mine (about 2 days ago). For some reason all my javascript files that are being served from my domain never get cached. When I look at the response headers, I always see “cf-cache-status: MISS”

Actually here are the headers:

cache-control: public, max-age=14400
cf-cache-status: MISS
cf-ray: 4a466e7aed85c09a-ORF
content-encoding: br
content-type: application/javascript; charset=UTF-8
date: Tue, 05 Feb 2019 15:32:45 GMT
etag: W/"69ba-168b9773580"
expect-ct: max-age=604800, report-uri=""
expires: Tue, 05 Feb 2019 19:32:45 GMT
last-modified: Mon, 04 Feb 2019 17:03:44 GMT
server: Cloudflare
status: 200
strict-transport-security: max-age=15552000; includeSubDomains
vary: Accept-Encoding
via: 1.1 vegur
x-content-type-options: nosniff
x-dns-prefetch-control: off
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block 

I even setup a page rule on my static path (/static/*) to cache everything but still no luck.

Like I said, I am probably missing something easy.


Absent a URL to test I would assume it’s one of these:

  • If the Cache-Control header is set to “private”, “no-store”, “no-cache”, or “max-age=0”, or if there is a cookie in the response, then Cloudflare will not cache the resource.

Sorry for not including a URL. Here is one:

Thanks for your help!

No worries, on the URI. Your origin is sending a max-age=0 header telling us not to cache it.

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

To test yourself:

curl -Ikv --resolve

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