What one curl request shows about a CDN cache
· sitewarm
A CDN is not one cache. Cloudflare, Fastly and Amazon CloudFront each describe caching as something that happens at a location: a data center, or a point of presence (POP). The consequence for a single curl request is that it shows what one location answered, at one moment. It cannot show what another location would answer.
This article is written from the three vendors' own documentation, read on 2026-11-18. Documentation changes, so check the pages listed under Sources before acting on a detail. Where the pages say nothing, the article says "Not verified". The commands and header values are illustrative and were not captured from a real site. Tiers and shielding are covered in how to read Age, Cache-Control and X-Cache, and appear here only as far as they change what one request shows. For what each cf-cache-status value means, see what each cf-cache-status value means.
What each vendor says about where a copy is stored
The three vendors do not use the same words, and they do not say the same amount. The table keeps each statement attached to its page.
| CDN | What the page says | Page |
|---|---|---|
| Cloudflare | "Cloudflare only caches resources within the Cloudflare data center that serve the request." The sentence sits in a passage about which resources are cached, so it does not by itself say what other data centers hold. The Tiered Cache page says that without it, "if a piece of content is not in cache, the Cloudflare edge data centers must contact the origin server". | Cache, get started; Tiered Cache |
| Fastly | "The first time a cacheable resource is requested at a particular POP, the resource will be requested from your backend server and stored in cache automatically." The shielding page adds that, without shielding, requests reach POPs in various regions, "which in turn independently forward those requests to your origin servers". | Cache; Shielding |
| Amazon CloudFront | The delivery guide says DNS routes the request to the POP "that can best serve the request, typically the nearest CloudFront POP in terms of latency", which checks its own cache first. The AWS re:Post page is more direct: CloudFront "caches the object only in the edge location that received the request", and a request to another edge location finds no cached copy. | How CloudFront delivers content; AWS re:Post |
The CloudFront guide also describes regional edge caches that sit between the POPs and the origin, so a copy can exist at more than one layer. The two CloudFront pages are phrased differently and are attributed separately here. For Cloudflare, the pages read do not state in one sentence whether a copy stored in one data center is available to another. Not verified: that case, outside Tiered Cache.
Which location answered: the header that names it
A status header such as HIT is more useful with the location beside it. Each vendor documents something that names the answering location, and each has limits.
| CDN | Where the location appears | What the documentation says |
|---|---|---|
| Cloudflare | The Cf-Ray response header | A hashed value that ends in a three-letter code for the data center, for example 230b030023ae2822-SJC in the page's own example. When a request is routed through Argo Smart Routing or Argo Tiered Caching, the page says the code in the header sent to the origin indicates the data center connecting to the origin, not the ingress data center. |
| Fastly | The X-Served-By response header | The identity of the cache server acting as the delivery node, in the form cache-{datacenter}{nodeid}-{datacenter}. With shielding there can be more than one entry, separated by commas. Fastly warns that the value is accurate at the moment it is generated and should not be compared with a value captured at another time, because cache nodes move in and out of service and codes can be reused. |
| Amazon CloudFront | The x-amz-cf-pop response header, and the x-edge-location field in standard logs | The re:Post page says to read x-amz-cf-pop to check the edge location. The logging reference describes x-edge-location as a three-letter code plus a number, for example DFW3, where the letters typically match the IATA code of an airport near the location and might change in the future. Not verified: the format of the x-amz-cf-pop value, and whether it matches x-edge-location. |
One command reads the status, the location and Age from a single response. It sends a GET and throws the body away.
# Illustrative command, placeholder domain
curl -s -D - -o /dev/null https://www.example.com/ | grep -i -E '^(cf-cache-status|cf-ray|x-cache|x-served-by|x-amz-cf-pop|age):'Save the location with the status every time. A HIT with no location is a result without its context.
What one request proves
- The status header on that response is the CDN's report about that response. Each vendor defines the values of its own header in its own documentation, and Cache-Status is the standard header meant to report cache handling.
- A
HITshows that a copy existed in the cache that answered. AMISSshows that one was not there when the request arrived. - The location header, when the response carries one, shows where that answer came from.
That is a complete observation of one location. It is evidence about that location and nothing else.
What one request does not prove
- That other locations hold a copy. The re:Post page says a request that reaches another edge location finds no cached version and returns
X-Cache: Miss from CloudFront. Fastly describes the fill happening at a particular POP. - That a
MISSmeans the page is not cacheable. Cloudflare definesMISSas a response that is eligible for cache but was not present at request time. The re:Post page lists reasons a CloudFront request can miss beyond the location: an object that is not requested often can be removed before it expires, and different forwarded headers, cookies or query strings change which entry a request looks for. See cache keys. - That the next request reaches the same location. CloudFront's guide describes DNS routing to the POP that can best serve the request, and the re:Post page suggests repeating requests and checking which edge location answers. Not verified: how Cloudflare and Fastly assign a request to a location, because the pages read do not describe it.
- That one location is one cache. Fastly's request collapsing page says a request can arrive on any edge server, and the delivery server may forward it to another server in the POP that is responsible for storing that object. The
X-Cache-Hitspage says the hit count "is per-cache-server, not per-data-center" and is not evenly spread across nodes. A number or a status read from one server is not a figure for the whole POP. - That a
HITwill still be aHITlater.Agedoes not say how long the answering location has held the copy. RFC 9111 defines it as the sender's estimate of the time since the response was generated or successfully validated at the origin. See Age.
Tiers and shielding change what a status means
Each vendor puts another cache behind the location that answers you. Cloudflare describes lower and upper tiers, where only an upper tier asks the origin. Fastly describes a shield POP that requests funnel through, and notes that a hit may come from a POP other than the first one that handled the request. CloudFront describes regional edge caches that the POPs in a region share, and an optional Origin Shield in front of the origin. So a MISS at the location that answered you is not a report that the origin was contacted, and the origin's logs are not a count of locations. The same pages describe the arrangement as a way to reduce requests to the origin. For the headers that show it, see how to read Age, Cache-Control and X-Cache and tiered caching.
A routine that fits what one request can show
- Run the command above and write down the status, the location and
Age. - Run it again straight away. If the location is the same and the status moved from
MISStoHIT, that location filled its cache. If the location changed, the second request is a first observation of a different location, not a repeat of the first. - Do not compare Fastly
X-Served-Byvalues taken at different times. Fastly says they are not comparable. - Treat a result from another machine or network as another observation. CloudFront describes routing by DNS to the POP that can best serve the request, so a different network may reach a different location. Not verified: the same behavior for Cloudflare and Fastly.
- Treat
curl -Iwith care. It sends a HEAD request, and none of the pages read says whether a CDN answers HEAD from the same cache entry as GET. Not verified: that equivalence. - To learn about a location your visitors use, you need a request that enters there. Not verified: whether each vendor offers a way to direct a test request to a chosen location.
The vendor pages are the reference for each CDN. The guides for Cloudflare, Fastly and Amazon CloudFront cover how each one names its cache states.
Where sitewarm fits
After a Production deploy, the open-source sitewarm GitHub Action checks the pages you choose and posts a GitHub Check on the commit. It turns red when a page starts returning an error, becomes noindex, or stops being served from cache, compared with your previous Production deploy. It is measured from the GitHub runner, from one CDN point of presence.
Frequently asked questions
Does a MISS from one curl request mean the CDN is not caching my page?
Not by itself. A MISS reports what the location that answered did with that one request. Cloudflare defines MISS as a response that is eligible for cache but was not present in the cache at request time. CloudFront's re:Post page explains that when a request reaches another edge location, that location has no cached copy and returns X-Cache: Miss from CloudFront, and it lists other causes: infrequent requests, and different headers, cookies or query strings in the cache key.
How do I see which CDN location answered a request?
Each vendor documents a header or log field. Cloudflare's Cf-Ray header ends in a three-letter code for the data center that processed the request. Fastly's X-Served-By names the cache server acting as the delivery node, in the form cache-{datacenter}{nodeid}-{datacenter}. CloudFront's re:Post page says to read x-amz-cf-pop, and its log field x-edge-location holds a three-letter code plus a number. The format of the x-amz-cf-pop value is not verified.
Why can a second request give a different result from the first?
One reason is that the first request filled a copy and the second found it. Another is that the second request was answered somewhere else. CloudFront's guide says DNS routes a request to the POP that can best serve it, typically the nearest by latency, and re:Post suggests repeating requests and checking which edge location answers. How Cloudflare and Fastly assign a request to a location is not verified here.
If one location has a copy of a page, do the other locations have it?
The pages read do not say so. CloudFront's re:Post page says it caches the object in the edge location that received the request, and Fastly's cache page describes the first request at a particular POP filling the cache there. Cloudflare's pages describe lower and upper tiers, and CloudFront describes regional edge caches that POPs in a region share, so what is shared depends on those layers.
References
- Cloudflare: Cache, get startedhttps://developers.cloudflare.com/cache/get-started/
- Cloudflare: Tiered Cachehttps://developers.cloudflare.com/cache/how-to/tiered-cache/
- Cloudflare: cache responses (CF-Cache-Status)https://developers.cloudflare.com/cache/concepts/cache-responses/
- Cloudflare: HTTP request headers (Cf-Ray)https://developers.cloudflare.com/fundamentals/reference/http-headers/
- Fastly: Cachehttps://www.fastly.com/documentation/guides/concepts/cache/
- Fastly: Shieldinghttps://www.fastly.com/documentation/guides/concepts/shielding/
- Fastly: X-Served-Byhttps://www.fastly.com/documentation/reference/http/http-headers/X-Served-By/
- Fastly: X-Cache-Hitshttps://www.fastly.com/documentation/reference/http/http-headers/X-Cache-Hits/
- Fastly: Request collapsing (clustering and shielding)https://www.fastly.com/documentation/guides/concepts/cache/request-collapsing/
- Amazon CloudFront: How CloudFront delivers contenthttps://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowCloudFrontWorks.html
- AWS re:Post: Why does my CloudFront distribution return an X-Cache: Miss from CloudFront responsehttps://repost.aws/knowledge-center/cloudfront-x-cachemiss-error
- Amazon CloudFront: standard logging reference (x-edge-location)https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/standard-logs-reference.html
- Amazon CloudFront: Origin Shieldhttps://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html
- RFC 9111: HTTP Caching (Age)https://www.rfc-editor.org/rfc/rfc9111
See the cache state your CDN returns for each page
sitewarm requests pages from your sitemap, up to the scan's URL limit, after a deploy and reports the cache state the CDN returns for each one, with the vantage point it was measured from.