Investigating ArvanCloud Cache Responses
The ar-cache response header is used to make sure that the website’s resources are cached in ArvanCloud edge servers. The phrase present in this header indicates caching status .
This article discusses the possible states of this header .
Various Caching States and their Meaning
After activating the ArvanCloud content distribution network or CDN for your website, ArvanCloud adds a specific header called ar-cache and informs you of caching status when your website’s resources are cached in ArvanCloud edge servers . To investigate response headers using the Chrome browser, you can click on settings, more tools, and developer tools or use Ctrl+Shift+I .
Cache status in this header can be one of the following states:
HIT: If this state is registered in ar-cache, the requested cache is in ArvanCloud edge servers, which respond to requests.
MISS: This state indicates that the requested resource is not present in ArvanCloud edge server, and the website’s main host server responds to this request.
EXPIRED: This state indicates that the requested resource is available in ArvanCloud edge server, but since it is expired, the website’s main host server responds to this request.
STALE: This state indicates that the ArvanCloud edge server has sent the old and expired resource in response since it is simultaneously validating this resource with the website’s main host server as a result of another user’s request. It’s worth mentioning that this state occurs very rarely.
IGNORED: This status means that the requested resource is not cacheable, but the website’s main host server has responded to this request as the number of requests has still not reached the threshold (usually 3). This status changes to HIT after the number of requests passes the threshold.
REVALIDATED: This status indicates that the ArvanCloud edge server has used an old version of the requested resource available in the cache to respond, with the difference being that in this state, the edge server has validated this resource using If-Modified-Since or If-None-Match headers from the website’s main host server.
UPDATING: This status indicates that the requested resource is being updated in the ArvanCloud edge server, and the response that has been sent now is an old version that was available in cache. This status often occurs when a resource that’s large in size, is being cached in the edge server.
What Does the Lack of ar-cache response header Mean?
If you see all of ArvanCloud’s headers while investigating headers, but the ar-cache is missing, this means that that resource is among your website’s external resources:
You can also read the following article to better understand different parts of Caching settings in the ArvanCloud panel.
Note that if your server settings are such that Cache Control headers are added to the website’s resources with the private and no-cache commands, ArvanCloud edge servers cannot cache these resources. So if you intend to save these resources in ArvanCloud edge servers, make sure that the correct instructions are specified for cache-control headers.