Purge the cache

Remove cached content by URL, prefix, hostname, Cache-Tag or everything; edge nodes apply it in about a second. Includes CI with a purge-only token.

On this page

A purge removes cached objects from every edge node; the next request for them goes to your origin. Edge nodes apply a purge within about a second, and you can see how many nodes have applied it.

Purge types

Each purge has exactly one type and up to 100 values:

TypeAPI fieldValuesRemoves
Everythingpurge_everythingtrueEverything cached for the zone, on every name.
URLsfilesFull URLs, e.g. https://www.example.com/app.css?v=2Those URLs, every variant (encodings, image formats, origins). The query string counts.
Prefixesprefixeshost/path, e.g. www.example.com/blog/Everything whose URL starts with it, any query.
HostnameshostsNames of the zone, e.g. static.example.comEverything cached for those names.
TagstagsCache-Tag values, e.g. product-42Every object with one of those tags.

Every value must belong to the zone, and the zone must be active. A purge isn't versioned configuration: it can't be reverted, and reverting a zone version never brings purged content back.

Purge

You need the tech or admin role, or a purge-only token.

  1. Go to Caching › Purge cache.
  2. Select Purge everything, or Custom purge and choose Purge by (URLs, Prefixes, Hostnames or Tags), then enter the values, one per line.
  3. Select Review: the dialog shows the values as the API normalized them, plus any warning.
  4. Select Purge. Recent purges shows its Propagation as applied nodes out of the caching nodes.

Limits

Purges are rate limited per organization:

PurgeLimit
Everything, prefixes, hostnames, tags10 per minute, bursts of up to 30
URLs500 URLs per minute (each URL counts once)

Over the limit the API answers 429 with code rate_limited and a Retry-After header. A zone that isn't active answers 409 (zone_not_active).

Purge from CI after a deploy

Create a token that can only purge one zone's cache, so your pipeline never holds a token that can change configuration:

  1. In API tokens, create a token with Cache purge only. It needs a domain in Scope and the role Tech. The dashboard then shows ready-to-paste snippets for curl, GitHub Actions and Coolify.

  2. Store the token as a secret named OPENWAF_PURGE_TOKEN in your CI, never in the repository.

  3. Call the purge after the new version is live:

    curl -fsS -X POST "https://dash.openwaf.dev/v1/orgs/$ORG/zones/$ZONE/cache/purge" \
      -H "Authorization: Bearer $OPENWAF_PURGE_TOKEN" \
      -H "Content-Type: application/json" \
      -H "X-Change-Reason: deploy" \
      -d '{"purge_everything": true}'

A purge-only token can call only POST …/cache/purge and GET …/cache/purges of its zone; everything else, MCP included, is refused with 403 (token_scope). See API tokens.

Audit

Every purge is recorded in the audit log as zone.cache.purge, with its type, values, number and reason.

Last updated:

↑↓ to navigate↵ to openesc to close