Cache-MISS scenarios¶
Refer this page to know the reasons - when the origin server can get user requests even when caching is enabled, or when CDN can serve old content.
Prerequisite¶
- You must have caching enabled on domain.
Details¶
The content you are accessing is typically served from the regional CDN Point of Presence (PoP) closest to you. However, the requested content may not be available in the cache for the following reasons:
- Error response: The origin server returned error for the request. CDNs usually do not cache errored responses unless specifically configured.
- Cache purge: The cache for the content was purged.
- First-Time access: The URL has never been accessed from your region (the CDN PoP serving your area).
- Cache expiry: The URL was accessed previously, but its cache expired after the cache Time-To-Live (TTL) interval set from the time the resource was cached at the respective CDN PoP.
- Cache variation: The CDN does not have the specific cache variation for your request.
- This can majorly occur if your request has different query parameters than those present in the cache.
By default, CDNs sort query parameters before creating the cache key to reduce cache variations.
However, if random query parameters likeutm
orga
are appended to the URL, a new cache variation will be created, resulting in a cache-MISS. - Additionally, content is variably cached based on factors such as device-type, requestor country, currency, and logged-in status.
If a request with the same combination of these conditions has not been made at your CDN PoP before, it will result in a cache MISS. - The response has set
vary
header for headers that can have numerous different values, such ascookie
oruser-agent
.
By default, CDNs honor this header, and create additional cache variations on top of existing cache variation rules.
If a request with the same combination of these conditions has not been made at your CDN PoP before, it will result in a cache-MISS.
- This can majorly occur if your request has different query parameters than those present in the cache.
- POST requests: Many major CDN providers cannot achieve a high cache-HIT percentage for POST requests due to technical and performance limitations.
Notes¶
- On N7, you can check you caching patterns and their TTLs at
Delivery > Caching > Request Caching
page. Documentation here. (Also check the Notes section.) - For checking the cache-variation rules set on N7, view
Delivery > Caching > Cache Variations
page. Documentation here. (Also check the Notes section.) - To purge anything on N7, use
Delivery > Caching > Purge Cache
. Documentation here. (Also check the Notes section.)
To purge the content programmatically by API, refer documentation here. - Sharing the cache across CDN PoPs is discouraged for the performance and integrity reasons, and is disabled by default.