What a purge invalidates and what stays cold
· sitewarm
A purge looks like one action, but it is several. Which copies it removes, which it only marks stale, and what the next request finds all depend on the CDN and on the kind of purge. This article compares what Cloudflare, Fastly, Amazon CloudFront and Vercel document about purging and invalidation, and where each page says content can be left behind.
It is written from each vendor's own documentation and RFC 5861, read on 2026-11-18. Documentation changes, so check the pages listed under Sources before acting on a detail. Where a page says nothing, the article says so. The commands are adapted from the vendor pages with placeholders, not captured from a real site.
Remove or mark stale: the choice behind every purge
Every CDN in this article offers two behaviors, under different names. One removes the cached copy, so the next request goes to the origin. The other keeps the copy and marks it stale, so the cache can revalidate it. The second is covered briefly in why cache warming matters; the vendor details are below.
| CDN | Remove the copy | Keep it and mark it stale |
|---|---|---|
| Cloudflare | Purge. The page says cached content is removed and the next request fetches the full response from your origin. | Invalidate, "sometimes called soft purge". The page says content is kept, marked stale, and revalidated with your origin on the next request. |
| Fastly | Hard purge. The page says it "permanently invalidates cached objects and makes them unusable for future requests". | Soft purge, available for a URL purge or a surrogate key purge. The page says it "invalidates an object and marks it as stale". |
| Amazon CloudFront | Invalidation. The page says the next time a viewer requests the file, CloudFront returns to the origin to fetch the latest version. | The pages read describe no variant that keeps the object as stale. Not verified: whether one exists. |
| Vercel | Delete. The page says entries are marked for deletion and the next request fetches content from your origin before responding. | Invalidate. The page says content is marked stale and the next request serves it while revalidation happens in the background. |
Words differ between vendors. Cloudflare's page uses "purge" for removal and "invalidate" for marking stale. Fastly uses "purge" for both and adds "hard" or "soft". CloudFront's page titled with invalidation describes the removal case. Check what the word means on your CDN before reading a guide written for another one. The glossary entry on cache invalidation gives the general terms.
What the next request finds after a removal
Removal does not fill the cache again. It empties a place, and the next request refills it. Cloudflare's single-file page says new requests for the purged asset receive the latest version from your origin and add it back to the cache "within the specific Cloudflare data center that served the request". Fastly's purge all page says the content has to be retrieved from your origin before it "can be re-cached in Fastly POPs". What a visitor meets after a purge is therefore a cold cache for that page, in each location that has not yet been asked for it.
The vendors describe the status you should then see:
- Cloudflare: after a purge by single file, by tag, by hostname, by prefix or of everything, the pages say
CF-Cache-StatusisMISSon the next request. For tag, hostname and prefix purges, they add that with Tiered Cache you may seeEXPIREDinstead, because the lower tier tries to revalidate with the upper tier. - Vercel: the page says an invalidated entry shows cache status
STALEwith the reason Tag-based invalidation, and a deleted entry showsREVALIDATEDwith the reason Tag-based deletion. - Fastly and CloudFront: the pages read describe the next request going to the origin but do not name a status value for it. Read the cache-status header your CDN returns, as in how to read Age, Cache-Control and X-Cache.
Purging everything is the case two of the four vendors warn about in so many words. Cloudflare's page cautions: "Every subsequent request must be served from your origin until the cache is repopulated", and says this can cause a large spike in origin requests. Fastly's page says purging all content "will temporarily cause your cache hit ratio to drop dramatically and cause an associated spike of traffic to your origin servers". Both pages point to narrower methods before it.
What the vendors say about timing
None of these pages gives a measured figure for how long a purge takes in practice, and this article does not either. The documents do contain some timing statements. They are quoted here with their source and are not the same kind of statement, so they are not comparable.
| CDN | Statement, from the vendor's page |
|---|---|
| Cloudflare | Purge cache page: "Cloudflare's Instant Purge ensures that updates to your content are reflected immediately." Single-file page: cached resources are "instantly removed" from the CDN "across all data centers". |
| Fastly | Purging all content page: "Purge all operations may take up to 2 minutes to complete." The pages read give no completion time for a URL purge or a surrogate key purge. Not verified: how long those take. |
| Amazon CloudFront | Invalidate files page: CloudFront "forwards the request to all edge locations within a few seconds, and each edge location starts processing the invalidation immediately". This describes forwarding and starting, not finishing. |
| Vercel | Purge page, in a note about Next.js pages that ISR already caches: a route cached by headers alone gives up, among other things, "300ms global purges". The page does not define the figure further and gives no other timing. |
Cloudflare's page adds a caution that matters more than any of the timing sentences. A successful purge request returns HTTP 200, and the page says this "indicates that Cloudflare received the request" and does not confirm that Cloudflare cached the targeted content or evicted any content. Its suggested check is to request the asset after purging and confirm that CF-Cache-Status is no longer HIT.
What a purge can leave behind
A purge targets what you name. Several vendor pages describe copies that a purge does not reach, and each is a reason a page can keep serving old content after a purge that looked successful.
- Variants under a custom cache key. Cloudflare's single-file page says that if a Cache Rule sets a custom cache key that includes headers or cookies, a single-file purge from the dashboard does not remove the cached resource, and the API is needed with those header and cookie values. It adds that a header missing from the purge request is treated as an empty value in the cache key. CloudFront's page describes a different behavior: when cookies or headers are part of the cache key, invalidating a file invalidates every cached version of it, and you cannot pick some versions. For query strings, it says to include them in the path or use the
*wildcard. See cache keys. - A different URL than the one you purged. Cloudflare's page says that if a URL returns a redirect, purging it removes the cached redirect and not the content at the destination, and that for a single-file purge with a Transform Rule you must use the end-user URL. Fastly's URL purge page lists a changed hash algorithm and rewritten URLs as reasons a purge appears to have no effect. CloudFront's page says that when a Lambda function changes the URI, you should invalidate both the viewer-request URI and the changed one.
- Objects with special request headers. Cloudflare's single-file page says a dashboard purge does not clear objects that contain an Origin header or any of a listed set of forwarding headers, and points to the API for them.
- A shield that was not purged yet. Fastly's purge all page describes a race when shielding is enabled: a request can reach a purged edge location first and be forwarded to a shield location that has not been purged yet, which delivers the cached content, and the edge caches it again. Its stated remedy is to purge twice, around 30 seconds apart.
- Copies outside the CDN. CloudFront's page says that if you invalidate a file, the user "might continue to see the old version until it expires from" a local cache or a corporate caching proxy. This is why that page recommends versioned file names for files you update often. None of the other purge pages read says whether browser caches are reached. Not verified: how each of the other CDNs treats them.
- Layers inside the platform. Vercel's page says a purge by cache tag purges three types of cache: the CDN cache, the Runtime Cache and the Data Cache. It also says a purge is not the same as a new deployment, because a purge also affects Image Optimization content and ISR content that a new deployment usually preserves.
Soft purge and stale-while-revalidate
A soft purge leaves a stale copy in place. What happens to it next is set by the stale directives in Cache-Control, defined in RFC 5861. The RFC says that stale-while-revalidate indicates that caches "MAY serve the response in which it appears after it becomes stale, up to the indicated number of seconds", and that the cache "SHOULD attempt to revalidate it while still serving stale responses (i.e., without blocking)". Its example is Cache-Control: max-age=600, stale-while-revalidate=30: fresh for 600 seconds, then possibly served stale for up to 30 more while validation is attempted.
# Adapted from the Fastly soft purge page; placeholders
curl -X PURGE -H "Fastly-Soft-Purge:1" https://www.example.com/page/
# Adapted from the CloudFront invalidation page; placeholder distribution
aws cloudfront create-invalidation --distribution-id DISTRIBUTION_ID --paths "/page/"The vendors tie the soft behavior to those directives in different ways:
- Cloudflare: its invalidation page says that with
stale-while-revalidateCloudflare can serve stale content while it revalidates in the background, and that without it, requests wait for revalidation to complete. For content that was still fresh, it says the stale-while-revalidate window starts when you invalidate, not when the content would have expired. - Fastly: its soft purge page recommends, before using one, setting up
ETagorLast-Modifiedon the origin, or configuringstale_while_revalidatetogether withstale_if_error. It adds that a purge all cannot be done as a soft purge and always invalidates immediately. - Vercel: its page says invalidating a tag serves stale content instantly while revalidation happens in the background, and deleting does not.
Two limits come from the sources themselves. First, a soft purge does not fetch anything. Cloudflare's page says invalidation "does not fetch new content in advance", and that the next request triggers revalidation. RFC 5861 says the same of the window: asynchronous validation happens only if a request arrives after the response becomes stale but before the window ends, and if "there is not traffic that triggers it", after the window the response is "truly" stale and the next request blocks and is handled normally. A page nobody asks for during the window is not refreshed by it. Second, a stale copy may or may not be served: Fastly's pages say that after a soft purge your service may continue to serve the pre-purge content based on your stale content settings, so a soft purge is not a way to remove content you must stop serving. Cloudflare's page says the same in other words: use a purge when cached content must not be served again, and update the content at the origin first, because otherwise the next request can cache the old version again.
Choosing what to purge by
What you can select differs, and it decides how much of the cache goes cold.
| CDN | Selectors the pages describe |
|---|---|
| Cloudflare | URL, hostname, cache tag, URL prefix, or everything. Single-file purge does not support wildcards. |
| Fastly | A URL, a surrogate key, or all content on a service. Soft purge is available for the first two. |
| Amazon CloudFront | Paths, where a * wildcard must be the last character, and cache tags, which need a CacheTagConfig on the distribution and a # prefix in the request. |
| Vercel | Cache tags, or a source image. The page says cache keys are not configurable and that to purge the cache you must configure cache tags. The dashboard accepts * to purge the entire project. |
Vendors name narrower methods as the safer default. Cloudflare says purge by single URL is the recommended method. Fastly's surrogate key page says that if you purge all more than weekly, you should consider surrogate keys. Tags are the common mechanism, and the glossary entry for surrogate keys explains how they work.
A short reading order after a purge
- Update the origin first. Cloudflare's page says to update or remove the content at your origin before you purge it.
- Request the page and read the status your CDN returns. Cloudflare's own check is that
CF-Cache-Statusis no longerHIT; for Vercel,STALEorREVALIDATEDwith the tag reason. - If the old content is still served, go through the list above in order: the variant, the URL that was actually cached, the shield, the stale settings, the copy outside the CDN.
- Treat one response as one location's answer. A status on a single request describes that response, not every location.
- Request the page again. After a removal, the refill is done by requests, so the second request tells you whether the page has been stored again.
Where sitewarm fits
sitewarm does not purge your CDN. When you start a scan, it requests the pages you list through your CDN and reports the cache status each one returned. After you purge, a scan shows which of those pages came back cold and which were already stored again. It reports what the scan observed from where it ran, not every location your CDN serves from.
Frequently asked questions
Is a soft purge the same as an invalidation?
Not by name across vendors. Cloudflare's documentation says invalidation, which keeps content and marks it stale, is sometimes called soft purge. Fastly calls the stale-marking variant a soft purge and the removing one a hard purge. CloudFront's invalidation page describes the next request going back to the origin. Check what the word means on your CDN. See cache invalidation.
Does a successful purge response mean the cache is clear?
Not on Cloudflare's own account. Its purge page says a successful request returns HTTP 200, which indicates that Cloudflare received the request and does not confirm that it cached the targeted content or evicted any content. It suggests requesting the asset after the purge and confirming that CF-Cache-Status is no longer HIT.
Why does the origin get a burst of requests after purging everything?
Because every purged page is cold at once. Cloudflare's page says every subsequent request must be served from your origin until the cache is repopulated. Fastly's page says purging all content will temporarily cause the cache hit ratio to drop dramatically and cause an associated spike of traffic to the origin. Both point to narrower methods first. See cold cache.
Does purging the CDN clear a visitor's browser cache?
The pages read do not say it does. CloudFront's invalidation page says a user might continue to see the old version until it expires from a local cache or a corporate caching proxy, and recommends versioned file names for files you update often. Not verified: how the other three CDNs treat browser caches.
References
- Cloudflare: purge cachehttps://developers.cloudflare.com/cache/how-to/purge-cache/
- Cloudflare: purge by single-filehttps://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-single-file/
- Cloudflare: purge cache by cache-tagshttps://developers.cloudflare.com/cache/how-to/purge-cache/purge-by-tags/
- Cloudflare: purge everythinghttps://developers.cloudflare.com/cache/how-to/purge-cache/purge-everything/
- Cloudflare: invalidate cached contenthttps://developers.cloudflare.com/cache/guides/invalidate-cache/
- Fastly: getting started with purginghttps://www.fastly.com/documentation/guides/full-site-delivery/purging/getting-started-with-purging/
- Fastly: soft purgeshttps://www.fastly.com/documentation/guides/full-site-delivery/purging/soft-purges/
- Fastly: purging a URLhttps://www.fastly.com/documentation/guides/full-site-delivery/purging/purging-a-url/
- Fastly: purging with surrogate keyshttps://www.fastly.com/documentation/guides/full-site-delivery/purging/purging-with-surrogate-keys/
- Fastly: purging all contenthttps://www.fastly.com/documentation/guides/full-site-delivery/purging/purging-all-content/
- Amazon CloudFront: invalidate files to remove contenthttps://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html
- Amazon CloudFront: what you need to know when invalidating pathshttps://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/invalidation-specifying-objects.html
- Amazon CloudFront: invalidate fileshttps://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation_Requests.html
- Amazon CloudFront: invalidating content by cache tagshttps://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/invalidation-by-tags.html
- Vercel: purging Vercel CDN cachehttps://vercel.com/docs/caching/cdn-cache/purge
- RFC 5861: HTTP Cache-Control Extensions for Stale Contenthttps://www.rfc-editor.org/rfc/rfc5861
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.