How to verify the cache status of a web content?

A quick way to verify the cache status of specific web content (static content) of your website is by checking the response header using the browser’s developer tools (or dev tool). In this article, we will focus on Chrome’s dev tool as an example.

Preliminary step:

First, review the cache rule that you set on the VNIS platform, in order to identify whether your target content is qualified/included in the CDN cache rule.

To review the cache rule, navigate to ‘ Multi CDN’ > ‘Cache control’ > ‘Cache rules’ tab.

In case your target content is not qualified/included in your cache rule, you can create a new cache rule by following the steps provided in this article.

Step 1:

Open your website on a browser, for example open www.mlytics.com on Chrome.

Step 2:

Right-click on any free space on your webpage, and select the browser developer tool (e.g. “Inspect” for Chrome). 

Note: other browsers will have different name/option for their developer tools, for example Firefox will have “Inspect Element” instead.

Step 3:

After you open the dev tool, refresh your page to reload the content of your webpage. This will allow the dev tool to collect all information when accessing your webpage, including all the HTTP headers and their corresponding values.

This is what it may look like after refreshing:

Step 4:

Select the “Network” tab on the dev tool section and search for the content that you would like to examine.

You may look for it under the “All” section, or in a more specific section, such as “JS”, “CSS”, “Img”, “Media”, etc.

Step 5:

After you found your target content (for example “4284310.js”), select the “Header” tab and examine the “Response header” section. The “Response header” will contain the cache-related headers for your target content. 

Step 6:

Look for any cache-related headers to verify whether your target content was successfully cached on a CDN or not.

Note: different CDN providers use different headers to indicate the cache status of contents.

In the example above, you may find Cloudflare’s cache-related header, namely “cf-cache-status” header to verify the cache status of your target content.

Step 7:

You can now verify the cache status of your target content.

For Cloudflare, if the value is “ HIT” then it means that your target content was found on Cloudflare’s cache. If the value is “MISS” then it means that your target content was not found on Cloudflare’s cache and was served directly from your origin server.

The table below summarizes the cache-related headers from different CDNs and their corresponding values.

CDN Cache-related headers Cache status value
GMA and CN2 x-mly-cache Hit or Miss
Note: Miss means either the content was not found on the cache, or the cache has expired
Cloudfront x-cache Hit or Miss
StackPath x-hw Check for the cache code:c, p, etc.
Reference
CDNetworks X-Px Ht or Ms
Cloudflare cf-cache-status HIT, MISS, etc.
Reference
Akamai X-Cache
Note: the user should attach the Pragma headers to return this response header
TCP_HIT, TCP_MISS, etc.
Reference
VNCDN X-Cache HIT or MISS
Baishan X-Cache HIT or MISS
Alibaba x-cache HIT or MISS
Chunghwa x-cache HIT or MISS
Tencent X-Cache-Lookup Hit or Miss
Wangsu Age If Age header exist > HIT,
If Age header doesn’t exist > MISS
Chinacache x-cc-via H or M