Cloudflare returns the cache status of an online resource through a response header called CF-Cache-Status. This header does not cause any behavior changes in web browsers, it is simply there as a way for the webmaster to know whether the resources are being cached or not. This tool will perform a basic head request against the URL you provide. It will check the headers to see if it contains the CF-Cache-Status header and if it does, it will check to see if it equals a hit.
There are 5 possible response types that the CF-Cache-Status header can contain. You can read each of them below with a description of what they mean.
HIT: This is obviously a positive response. The record is cached and the request made through the CDN hit the cache and did not hit your web server.
MISS: The cache was checked but the requested resource was not found. The following request will likely be a HIT
BYPASS: Cloudflare has been instructed not to cache this resource, likely through a page rule.
EXPIRED: This resource was cached before but has been living in the cache longer than the specified time for the cache to live. The cache will be refreshed for the next request.
DYNAMIC: This will appear if you are requesting a resource that Cloudflare does not cache by default. This is essentially a miss.
Help, CF-Cache-Status Header Is Missing!
If you are confident that all of your traffic is routed through Cloudflare’s CDN, and you can see a CF-RAY header in the response, why is the cache status header missing too? It could be for a few reasons, but it is most likely due to either a configuration issue where you have accidentally instructed Cloudflare not to cache this particular resource. Or because the content type of the resource you are requesting is not something that is normally cached by default. Typically you would see a dynamic header for this though.
How To Cache HTML With Cloudflare
If you are using a CMS like WordPress, you will need to be careful about this. If your wp-admin page is cached, non logged in users will be able to view the data. They may not be able to save or modify anything but they will see be able to gain access to sensitive administration pages. This is why you should make sure to use additional page rules to add cache bypassing exceptions. The image below will show some examples of how to achieve this.
How To Manually Check If Cloudflare Cached a Resource
If you want to be able to check for this manually, you can visit a URL in your web browser and check the headers manually. To do this. Right-click on a page and click on “Inspect Element”. Firefox and Chrome both have the same setting for this. It will open a window with some HTML and there will be some tabs along the top. Move over to the “Network” tab. Minimize this window and go back to the main window and either refresh the current page or navigate to the page you want to test.
Once the page has loaded, go back to the inspection window and if you click on the resource, you will be able to see the CF-Cache-Status header listed with all of the other HTTP headers. The response type will be visible here.
The tool at the top of this page takes the manual process away. Enter your URL and this tool will perform this manual check for you automatically. The Cloudflare cache detector will simply check whether the response is present and let you know if the response is good news or bad news.