Insights

Cloudflare's CF-Cache-Status Headers Explained

What Are CF-Cache-Status Headers?

When using Cloudflare you’ll soon learn that the cf-cache-status response headers contain invaluable information by lending insight into what’s really going on. In this post, we're going to look at the specifics of the cf-cache-status header what its values mean.

CF-CACHE-STATUS header from Cloudflare.

The presence of cf-cache-status indicates that the site is using Cloudflare. The value of HIT indicates that this resource has been returned from Cloudflare’s cache.

And you’re very new, to get the above window I simply:

  • Loaded Cloudflare.com.
  • Opened Chrome’s Developers tools (right-clicked the page, selected “Inspect…”).
  • Selected “Network” tab.
  • Filtered by “Document” traffic (proper web pages).
  • Selected on “www.cloudflare.com” in the resource list.
  • Selected “Headers”.

Cloudflare performance solutions banner for Fishtank services

Cloudflare Status Headers

Here is an overview of the popular values returned by cf-cache-status and their meaning.

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.

If you would like to influence what is cached and how something is cached by Cloudflare, Page Rules are a recommended option. For the more advanced, take a look at Cloudflare Workers

I would recommend Redbot as tool to help understand and validate your resources headers.

Thanks for reading.

👋 Hey Sitecore Enthusiasts!

Sign up to our bi-weekly newsletter for a bite-sized curation of valuable insight from the Sitecore community.

What’s in it for you?

  • Stay up-to-date with the latest Sitecore news
  • New to Sitecore? Learn tips and tricks to help you navigate this powerful tool
  • Sitecore pro? Expand your skill set and discover troubleshooting tips
  • Browse open careers and opportunities
  • Get a chance to be featured in upcoming editions
  • Learn our secret handshake
  • And more!
Sitecore Snack a newsletter by Fishtank Consulting
 

Meet Dan Cruickshank

President | Sitecore MVP x 11

Dan is the founder of Fishtank. He's a multi-time Sitecore MVP and Coveo MVP award winner. Outside of technology, he is widely considered to be a top 3 father (routinely receiving "Father of the Year" accolades from his family) and past his prime on the basketball court.

Connect with Dan