As the lead for a sports-results publisher running several zones on one Cloudflare account, what purge policy would you set, and who may purge everything?
answer
- limits are per account, per plan
- tags as the default selector
- purge versus invalidate
- a scoped Cache Purge token
- purge everything needs a reason
basics
~20 sMake CMS-driven purge by tag the default and Purge Everything an incident action with sign-off. Keep the Cache Purge permission in one service, batch against the shared per-account limits, and invalidate only content that may be served stale.
solid answer
~50 sI would route every routine purge through **one purge service** that the CMS calls on publish. It sends **purge by tag** for the units editors change (a match, a team, a league table), batched up to 100 tags a request, because Cloudflare's tag, prefix, hostname and everything limits are a **token bucket per account shared by every zone on the same plan**, and invalidation draws on the same bucket. Corrections that must never be served again are **purged**; bulk refreshes of mostly unchanged content are **invalidated**, since invalidated content can still be served stale. The service holds the only API token with **Cache Purge** on the zones it serves. **Purge Everything** is reserved for incidents, approved by the on-call lead, because every request then goes to the origin, and on Cache Reserve every object is refetched. The audit logs show who purged what.
go deeper
Recall that purge permissions and limits exist and that Purge Everything sends every next request to the origin.
Explain the per-account, per-plan token bucket and the difference between purging and invalidating content.
Design a tag scheme, batch purges against shared limits, and know which jobs should invalidate instead of purge.
Own the policy: who holds Cache Purge, when Purge Everything is allowed, how purges are paced and audited, and which signals reopen the decision.
## The decision On Cloudflare, anyone with the **Cache Purge** permission can empty a zone's cache in one click, and every purge draws from limits the whole account shares. A sports publisher with a scores site, a news site and an API on separate zones therefore has to decide **who may purge what, with which selector, and how**, before match day decides it for them. There is no single right answer; the policy trades freshness against origin load, operations cost and how much the CMS must know. ## The facts the policy rests on - **Every purge type is on every plan** since April 2025: by URL, tag, hostname, prefix and everything. - **Limits are per account, shared by every zone on the same plan.** Tag, hostname, prefix and purge everything requests use a token bucket: 5 requests a minute with a bucket of 25 on Free, 5 a second (25) on Pro, 10 a second (50) on Business, 50 a second (500) on Enterprise, each request carrying at most 100 operations. URL purges have their own rates, 800 to 3,000 URLs a second by plan. **Invalidation counts against the same limits.** - **Purge removes, invalidation marks stale.** Since September 2026 the `invalidate_cache` endpoint takes the same selectors; with an `ETag` or `Last-Modified` from the origin, unchanged content comes back with a `304` instead of a full download, but it can be served stale while revalidating or while the origin returns errors. - **Purge everything** sends every next request to the origin until the caches refill, and with Tiered Cache the refill propagates through both tiers. With Cache Reserve, every object is refetched in full and rewritten. - **Version Management**: purging everything in the production environment purges all environments. - **Audit logs** have recorded each purge request, its selectors and its actor since November 2025. ## A policy I would propose 1. **One purge service.** The CMS and deploy pipeline call an internal service instead of Cloudflare directly. It holds the only API token with **Cache Purge** on the zones it serves, kept on the server side, and it batches and paces requests so one zone's burst cannot drain the bucket every other zone on the plan shares. 2. **Tags are the default selector.** Origins tag responses by edit unit (`match-8812`, `team-rovers`, `league-premier`). A correction purges its tags; nobody hand-maintains URL lists. 3. **URL and prefix purges for the exceptions**: a single asset, a directory being retired. 4. **Purge for wrong content, invalidate for refreshes.** A wrong score is purged after the origin has the fix. A nightly refresh of archives that are mostly unchanged is invalidated, provided the origin sends validators. 5. **Purge Everything is an incident action**, approved by the on-call lead, run outside peak traffic, with origin capacity watched while caches refill. Dashboard roles that include Cache Purge are kept to that on-call group. 6. **Verify and review.** The service checks `cf-cache-status` on a sample of URLs after each purge, and the team reviews purge audit logs and purge volume each month. ## Tradeoffs to argue | Choice | Gain | Cost | | --- | --- | --- | | Fine-grained tags | Small, precise purges, less origin load | Tag design in every origin; the 16 KB `Cache-Tag` header limit | | Coarse tags or hostname purges | Simple CMS logic | Each correction refetches far more than it changed | | Central purge service | Pacing, one token, one audit trail | Another service to run; a bottleneck if it fails | | Teams purge directly | No dependency | Shared limits drained by one team's job; tokens spread around | | Invalidate by default | Lower origin egress for unchanged content | Stale content may be served; needs validators | ## Signals that the policy needs changing - Purge requests failing on the rate limit during match days: batch harder or move the noisiest zone's plan. - Origin load spikes after routine purges: tags are too coarse, or a job is purging what it should invalidate. - Cache Reserve Class A operations climbing after purge jobs: switch those jobs to invalidation. - Editors reporting corrections that did not appear: look for variants a URL purge misses, or purges sent before the origin published.
- Why would one team's purge job hurt another team's zone on the same account?Purge limits are per account, and every zone on the same plan draws from the same bucket. A job sending hundreds of tag purges from one Pro zone can empty the 25-token bucket, and the other Pro zones' purges must wait for tokens to refill. Invalidation requests take from the same bucket.
- When would you allow invalidation for score pages?Only for refreshes where serving the old page for a short while is acceptable, such as a periodic resync. A wrong score should be purged: invalidated content can be served stale while it revalidates and, by default, while the origin returns errors, which is exactly when a correction must not be lost.
- Each zone has its own purge rate limit, so teams cannot affect each other.
- Invalidation is a cheaper purge with the same guarantees.
- Everyone with dashboard access should be able to purge everything.
- Purge everything is harmless because Tiered Cache absorbs the refill.
- Purge requests need no audit trail because they change no settings.
Assumes Cloudflare as of 2026-10-10: every purge type on every plan since April 2025, purge events in audit logs since November 2025, and the invalidate_cache endpoint since September 2026.