What do the various Cloudflare cache responses (HIT, Expired, etc.) mean?

It is possible to check if Cloudflare is caching my site or a specific file by checking the responses shown in the "CF-Cache-Status" header, this article explains what these responses may be. 

Note: Cloudflare's static content caching is dependent on both (a) where most of your visitors are coming from and which Cloudflare datacenter they are hitting, and (b) how may times those resources are requested at the specific datacenter. As such, Cloudflare does not cache the same resources for your site globally at every datacenter location.

HIT: resource in cache, served from CDN cache

MISS: resource not in cache, served from origin server

EXPIRED: resource was in cache but has since expired, served from origin server

STALE: resource is in cache but is expired, served from CDN cache because another visitor's request has caused the CDN to fetch the resource from the origin server. This is a very uncommon occurrence and will only impact visitors that want the page right when it expires.

IGNORED: resource is cacheable but not in cache because it hasn't met the threshold (number of requests, usually 3), served from origin server. Will become a HIT once it passes the threshold.

REVALIDATED: REVALIDATED means we had a stale representation of the object in our cache, but we revalidated it by checking using an If-Modified-Since header.

What if there no "CF-Cache-Status" header?

If the "CF-Cache-Status" header is missing (but you are seeing other Cloudflare headers such as "CF-RAY"), this can indicate that the resource is not something we would ordinarily cache. There is a list of file extensions we cache by default and you can utilise Page Rules to implement custom caching options (including static content and HTML).

Notes:

-Cloudflare will not cache your site or static content if you have  no-cache and private headers coming from your server. If you want Cloudflare to cache content on your site, please make sure that the headers are changed to allow caching. If you don't know what your headers are returning, please use a service like Redbot to check.

-Cloudflare does not cache off-site or third-party resources (widgets, etc.).

-Cloudflare will only proxy and cache records where Cloudflare is proxying that record in your DNS settings.

-You can adjust your caching level and cache TTL in your Cloudflare caching settings under the section 'Speed'.

Still not finding what you need?

The CloudFlare team is here to help. 95% of questions can be answered using the search tool, but if you can’t find what you need, submit a support request.

Powered by Zendesk