Learn more about the CF-Cache-Status header and what the various responses mean.
Cloudflare's static content caching is dependent on, where most of your visitors are coming from, which Cloudflare datacenter they are hitting, and how many times those resources are requested at the specific datacenter.
Cloudflare does not cache:
- off-site or third-party resources
- DNS records that aren't proxied through Cloudflare
- sites or static content that have no-cache or private headers coming from your origin server
It is possible to check if Cloudflare is caching your site or a specific file by checking the responses shown in the "CF-Cache-Status" header. You can adjust your caching level and cache TTL in your Cloudflare caching settings under the section 'Speed'.
CF-Cache Status Responses
- resource in cache, served from CDN cache
- resource not in cache, served from origin server
- resource was in cache but has since expired, served from origin server
- resource is in cache but is expired, served from CDN cache because we tried to contact the origin but experienced an error
- the origin server instructs the CDN to always bypass cache, sets the header Cache-Control to no cache
- a stale representation of the object is in our cache, but was revalidated by using either an If-Modified-Since header or an If-None-Match header
- the resource is in the process of being cached and the response was served stale from the existing cached item. This status is typically only seen when large and/or very popular resources are being added to the cache.
CF-Cache-Status header missing
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 utilize Page Rules to implement custom caching options (including static content and HTML).