Skip to content

Commit 2d2fece

Browse files
committed
[Cache] Add missing purge edge-case documentation
- index.mdx: note that HTTP 200 does not confirm eviction - purge-by-single-file.mdx: redirect responses subsection - purge-everything.mdx: caution callout for origin cache-fill spike
1 parent abb84bf commit 2d2fece

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

src/content/docs/cache/how-to/purge-cache/index.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Cloudflare's Instant Purge ensures that updates to your content are reflected im
1616

1717
To purge cached content using the Cloudflare API, refer to [Purge Cached Content](/api/resources/cache/methods/purge/).
1818

19+
:::note
20+
A successful purge request returns HTTP 200. This indicates the request was received — it does not confirm that the targeted content was cached or that any content was evicted. To verify a purge, request the asset after purging and confirm that `CF-Cache-Status` is no longer `HIT`.
21+
:::
22+
1923
:::note
2024
If versioning is active on your zone and multiple environments are configured, you can select the specific environment you want to purge. For more details, refer to the [Version Management](/version-management/) documentation.
2125
:::

src/content/docs/cache/how-to/purge-cache/purge-by-single-file.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ Update your Cache Rule expression to also match on the `PURGE` method, for examp
5252

5353
For rules that match on fields which cannot be evaluated during purge (such as `cf.bot_management.score`), use [purge by prefix](/cache/how-to/purge-cache/purge_by_prefix/), [purge by tag](/cache/how-to/purge-cache/purge-by-tags/), or [purge everything](/cache/how-to/purge-cache/purge-everything/).
5454

55+
### Redirect responses
56+
57+
If the URL you want to purge returns a redirect (301 or 302), single-file purge removes the cached redirect response — not the content at the redirect destination. The resource at the destination URL remains cached.
58+
59+
To clear the destination content, purge the final destination URL directly. You can find it by checking the `Location` header in the response:
60+
61+
```bash
62+
curl -v https://example.com/redirecting-path 2>&1 | grep -i location
63+
```
64+
65+
Use the URL in the `Location` header for your purge request instead.
66+
5567
### Resources with special headers
5668

5769
A single-file purge performed through your Cloudflare dashboard does not clear objects that contain any of the following:

src/content/docs/cache/how-to/purge-cache/purge-everything.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ import { DashButton } from "~/components"
1313

1414
To maintain optimal site performance, Cloudflare strongly recommends using single-file (by URL) purging instead of a complete cache purge.
1515

16-
Purging everything instantly clears all resources from your CDN cache in all Cloudflare data centers. Each new request for a purged resource returns to your origin server to validate the resource. If Cloudflare cannot validate the resource, Cloudflare fetches the latest version from the origin server and replaces the cached version. When a site with heavy traffic contains a lot of assets, requests to your origin server can increase substantially and result in slow site performance.
16+
Purging everything instantly clears all resources from your CDN cache in all Cloudflare data centers. Each new request for a purged resource returns to your origin server to validate the resource. If Cloudflare cannot validate the resource, Cloudflare fetches the latest version from the origin server and replaces the cached version.
17+
18+
:::caution
19+
When you purge everything, all cached content for your zone is removed at once. Every subsequent request must be served from your origin until the cache is repopulated. On high-traffic sites with many assets, this can cause a large spike in origin requests and may significantly slow down your site or overload your origin server.
20+
21+
Before using purge everything, consider whether a more targeted method — such as [purge by URL](/cache/how-to/purge-cache/purge-by-single-file/), [purge by prefix](/cache/how-to/purge-cache/purge_by_prefix/), or [purge by tag](/cache/how-to/purge-cache/purge-by-tags/) — can achieve the same result with less impact on your origin.
22+
:::
1723

1824
1. In the Cloudflare dashboard, go to the **Configuration** page.
1925

0 commit comments

Comments
 (0)