Documentation menu
Docs › Caching
Purging content
Purging removes content from every location so the next request fetches a fresh copy. A purge reaches all 52 cities in about 150 ms at the median.
Purge methods
| Method | Use it for | Plans |
|---|---|---|
| By URL | A handful of specific pages or files. | All |
| By prefix | Everything under a path, such as /blog/2026/. | All |
| By cache tag | Every object related to one thing, wherever it lives. | Pro and above |
| Everything | Emergencies only. | All |
Purge by URL
curl -X POST https://api.cache.bz/v1/sites/$SITE_ID/purge \
-H "Authorization: Bearer $CACHEBZ_TOKEN" \
-H "Content-Type: application/json" \
-d '{"urls": ["https://www.example.com/index.html", "https://www.example.com/pricing"]}'Up to 500 URLs per request. URLs are matched against every variant of the cache key, so you do not need to purge each encoding or device class separately.
Purge by cache tag
Tags let you purge by meaning rather than by location. Your origin sends a Cache-Tag header with a comma-separated list of tags; we index them and strip the header before the response reaches the browser.
HTTP/1.1 200 OK
Content-Type: text/html
Cache-Control: public, max-age=3600
Cache-Tag: article-1842, author-77, section-science, homepageWhen article 1842 is edited, purge its tag and every page that shows it, from the article itself to the homepage teaser, is refreshed:
cachebz purge --tag article-1842
# equivalent API call
curl -X POST https://api.cache.bz/v1/sites/$SITE_ID/purge \
-H "Authorization: Bearer $CACHEBZ_TOKEN" \
-d '{"tags": ["article-1842"]}'Tags are case-insensitive, up to 128 characters from A-Z a-z 0-9 - _ . :, and up to 64 tags per response.
Soft purge
A soft purge marks objects as stale instead of deleting them. The next visitor is served the stale copy while the edge revalidates in the background, so your origin never sees a stampede. Add "soft": true to any purge request. This works best together with stale-while-revalidate.
Purge everything
cachebz purge --all --confirm www.example.comPurging everything sends every next request to your origin. It is rate limited to once per minute per site; prefer a soft purge or a tag purge whenever you can.
Checking progress
Every purge returns an ID. Poll it to see per-location acknowledgements, or let the CLI wait for you with --wait.
{
"id": "prg_01JD8M3Q2V",
"status": "completed",
"locations_acknowledged": 52,
"locations_total": 52,
"duration_ms": 162
}