> ## Documentation Index
> Fetch the complete documentation index at: https://bunny.net/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Purge Cache

> Clear cached content from your Pull Zone to serve fresh files from your origin.

Purge cached files when you need visitors to see updated content immediately rather than waiting for cache expiration.

You can purge the entire Pull Zone, only files with a specific tag, or specific URLs. The dashboard supports full and tag purges. URL purges are available through the [API](#purge-by-url).

<Warning>
  Purging large zones puts temporary load on your origin server while content is
  re-cached. Performance may decrease briefly until edge nodes repopulate.
</Warning>

<Note>
  Bunny CDN does not monitor your origin for file changes. Once a file is cached, it stays cached until its `Cache-Control` lifetime expires or it's evicted to make room for more popular content. To reflect a change immediately, purge the cache or serve the file under a new query string (such as `?v=2`).
</Note>

## Dashboard

<Steps>
  <Step title="Open your Pull Zone">
    Go to your Pull Zone in the [dashboard](https://dash.bunny.net) and click **Purge Cache** in the top right corner.

    <Frame>
      <img src="https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/cdn/purge-cache-button.png?fit=max&auto=format&n=GYo51EPI6zuebYhU&q=85&s=0b0ae96f88daa780a9fea2c108967bad" alt="Purge cache button" width="2280" height="1240" data-path="images/cdn/purge-cache-button.png" />
    </Frame>
  </Step>

  <Step title="Enter a search tag (optional)">
    Leave the search tag empty to purge the entire Pull Zone. If you enter a tag, only files with a matching `CDN-Tag` header are removed. The rest of your cache stays intact.

    <Frame>
      <img src="https://mintcdn.com/bunnynet-cb9733c2/1bTPx1eyQm8EK8W3/images/cdn/full-cache-purge-or-by-tag.png?fit=max&auto=format&n=1bTPx1eyQm8EK8W3&q=85&s=87fef34f41949d4432fda1bf3ae4b83e" alt="Purge cache by tag" width="760" height="862" data-path="images/cdn/full-cache-purge-or-by-tag.png" />
    </Frame>
  </Step>

  <Step title="Confirm the purge">
    Click **Purge** to clear the cache.
  </Step>
</Steps>

## API

You can also purge cache programmatically. See the [Core API reference](/docs/api-reference/core) for full details.

### Full Pull Zone purge

Use the [Purge Cache](/docs/api-reference/core/pull-zone/purge-cache) endpoint without a `CacheTag` to clear every cached file in the Pull Zone.

### Purge by tag

Tag responses from your origin with the `CDN-Tag` header. Then use the [Purge Cache](/docs/api-reference/core/pull-zone/purge-cache) endpoint with `CacheTag` set to purge all files matching that tag.

Useful for invalidating all assets related to a specific product, user, or category without clearing your entire cache.

<Note>
  `CDN-Tag` header values are limited to 1024 bytes. Longer values are truncated.
</Note>

### Purge by URL

Use the [Purge URL](/docs/api-reference/core/purge/purge-url) endpoint to purge a single file or a path prefix.

The URL you send decides the purge type, which also decides the [rate limit](#rate-limits) that applies:

* **Exact**: a URL without wildcards, where the path does not end with `/` or `exactPath` is `true`. For example, `https://example.com/image.png`.
* **Prefix**: the URL contains a `*`, or the path ends with `/` and `exactPath` is `false`. For example, `https://example.com/images/*` or `https://example.com/assets/`.

## Rate limits

To ensure platform stability, the Purge API is protected by rate limits. These limits are designed to keep normal purge workflows fast while preventing abuse or accidental overload.

Purge requests are rate-limited using a token bucket mechanism:

* Limits are applied per account
* Limits are applied per purge type
* Each purge item consumes 1 token
* Tokens refill steadily over time

Every purge counts toward one of two purge types:

* **Exact**: an [exact URL purge](#purge-by-url) or a [purge by tag](#purge-by-tag)
* **Prefix**: a [prefix URL purge](#purge-by-url) or a [full Pull Zone purge](#full-pull-zone-purge)

If a request exceeds the available rate limit, the API returns a `429 Too Many Requests` response with guidance on when to retry.

### Default rate limits

| Purge Type | Burst Capacity | Refill Rate | Approx. Sustained Rate |
| - | - | - | - |
| Exact | 120 tokens | 5 tokens/sec | \~300 per minute |
| Prefix | 20 tokens | 0.5 tokens/sec | \~30 per minute |

<Note>
  If your workload requires higher purge throughput, please [contact
  support](https://dash.bunny.net/support) to discuss custom rate limits.
</Note>

## Perma-Cache behavior

If you're using [Perma-Cache](/docs/cdn/perma-cache):

* **Full zone purge**: Clears CDN cache but Perma-Cache switches to a new directory (manually delete the old folder if needed)
* **Tag-based purging**: Not supported with Perma-Cache enabled


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.