CF: cf-cache-status headers explanation

When we are using Cloudflare in proxy mode, we see that the response headers contain invaluable information by lending insight into what’s really going on with our static object on pages.
This notice is small reminedr about the specifics of the cf-cache-status header, what its values mean.
It is very important in situations when you are making changes of css or js files and don’t see updates in window of browser, even if you are using suffixes for each URL.

When we work on site in production mode, each static object passthrough 3 level of caches before participation in rendering of page in browser:

  • cache plugin of WP(W3TC etc)
  • external caches of edge servers CF
  • local cache web browsers of clients

ClodudFlare adds own headers, informs us where were found objects for browse and thus, let us see what version of object we see in browser and when.

Table below explains this:

Cloudflare Header Description
cf-cache-status: HIT Your resource was found in Cloudflare’s cache. This means that it has been previously accessed from your original server and loaded into Cache. It has all not expired.
cf-cache-status: MISS Cloudflare looked for your resource in cache but did not find it. Cloudflare went back to your origin server to retrieve the resource. The next time this resource is accessed its status should be HIT.
cf-cache-status: BYPASS Cloudflare has been instructed to not cache this asset. It has been served directly from the origin. This is usually because something like a existing NO-CACHE header is being respected.
cf-cache-status: EXPIRED Cloudflare has previously retrieved this resource, but it’s cache has expired. Cloudflare will go back to the origin to retrieve this resource again. The next this resource is access its status should be HIT
cf-cache-status: DYNAMIC This resource is not cached by default and there are no explicit settings configured to cache it. You will see this frequently when Cloudflare is handling a POST request. This request will always go to the origin.

The presence of cf-cache-status indicates that the site is using Cloudflare. The value of MISS indicates that this resource was not be found in Cloudflare’s cache and was downloaded from origin server.

Scroll to top