What are possible X-Cache
values from CloudFront
? There does not seem to be a list of all possible values properly documented for this header from CloudFront.

- 155
- 1
- 3
- 14
1 Answers
In Amazon CloudFront, the X-Cache
header in the response from the CloudFront distribution provides information about whether the requested object was served from the CloudFront cache or fetched from the origin server. This header can help you understand the caching behavior and performance of your CloudFront distribution.
The X-Cache header can have different values, each indicating a different caching scenario:
X-Cache: Miss from cloudfront: This means that the requested object was not found in the CloudFront cache, so CloudFront fetched it from the origin server and stored a copy in the cache for future requests.
X-Cache: Hit from cloudfront: This indicates that the requested object was found in the CloudFront cache and was served directly from the cache to the viewer. This results in faster response times compared to fetching the object from the origin server.
X-Cache: RefreshHit from cloudfront: This value is seen when CloudFront serves a stale object from the cache while simultaneously fetching a new copy from the origin server to update the cache. This helps maintain availability while ensuring the cache is updated with fresh content.
X-Cache: Error from cloudfront: This indicates that an error occurred while trying to fetch the object from the cache or the origin server. The error details are typically provided in the response body or other headers.
X-Cache: Hit from cloudfront (Using cache for this request): This value is observed when a conditional GET request is made, and the cached object fulfills the conditions. CloudFront serves the cached object in response to the conditional GET request.
X-Cache: Miss from cloudfront (Generated by CloudFront): This value is seen when CloudFront dynamically generates a response, often due to a query parameter or request behavior that prevents the response from being served from the cache.
These values provide insights into the caching behavior of CloudFront and can help you troubleshoot performance and cache-related issues. Keep in mind that CloudFront's behavior and headers may evolve over time, so it's always a good practice to refer to the official documentation for the most up-to-date information.

- 155
- 1
- 3
- 14