Cloudflare's CF-Cache-Status Headers Explained
When using Cloudflare you’ll soon learn that the 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.
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 Status Headers
Here is an overview of the popular values returned by cf-cache-status and their meaning.
|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.|
I would recommend Redbot as tool to help understand and validate your resources headers.
Thanks for reading.