# Purge

**Purge** invalidates cached content across the Medianova CDN before its cache lifetime (TTL) expires.\
It ensures that updated content from your origin is immediately reflected and consistently served from all cache layers worldwide.

When a purge is executed, the Medianova purge system distributes invalidation commands across the CDN’s cache hierarchy. Cached objects are marked as expired and fetched again from your origin upon the next user request.

You can trigger a purge from the [Medianova Control Panel](https://cloud.medianova.com) or via [API](/api-documentation/performance-cdn/purge.md) .

### When to Purge Cached Content

Use purge whenever:

* Updated HTML, CSS, JS, images, or video files must be reflected immediately.
* Outdated or sensitive content needs to be removed from CDN caches.
* New deployments or configuration changes require instant cache refresh.
* Consistency across all cache layers is required after a content update.

{% hint style="info" %}
Combine purge operations with **shorter TTL values** for dynamic or frequently changing content.
{% endhint %}

### Types of Purge

Medianova supports multiple purge methods to give you flexibility and control:

<table><thead><tr><th width="180">Type</th><th width="384.0001220703125">Description</th><th>Example</th></tr></thead><tbody><tr><td><strong>Single File Purge</strong></td><td>Removes one specific file from all CDN caches.</td><td><code>/images/banner.jpg</code></td></tr><tr><td><strong>Wildcard Purge</strong></td><td>Removes multiple files using pattern matching.</td><td><code>/images/*</code></td></tr><tr><td><strong>Full CDN Resource Purge</strong></td><td>Clears all cached files for a specific CDN Resource.</td><td><code>/*</code></td></tr></tbody></table>

{% hint style="info" %}
Wildcard purge operations are recursive and affect all subdirectories.\
To use wildcard patterns, the **Wildcard Purge Suffix** option must be enabled under **CDN Settings**.
{% endhint %}

### How Purge Works

1. A purge request is initiated via the Medianova Control Panel or [API](/api-documentation/performance-cdn/purge.md).
2. Medianova’s purge system distributes invalidation commands to all cache layers.
3. Cached objects matching the path are **marked as invalid** and no longer served.
4. On the next user request, the CDN retrieves the fresh content from the origin and re-caches it.

{% hint style="info" %}
Cache propagation completes rapidly, depending on node density, region count, and network conditions.
{% endhint %}

### Purge Propagation & Behavior

Purge requests propagate through all layers of Medianova’s caching infrastructure extremely quickly – typically completing across our global network in under 5 seconds – ensuring that outdated content is swiftly replaced with fresh content worldwide.

<table><thead><tr><th width="238">Behavior</th><th>Description</th></tr></thead><tbody><tr><td><strong>Instant Global Invalidation</strong></td><td>Cache invalidations propagate rapidly across all CDN cache layers.</td></tr><tr><td><strong>Parallel Distribution</strong></td><td>Purge commands are broadcast concurrently to all cache nodes for faster execution.</td></tr><tr><td><strong>Independent Caches</strong></td><td>Each CDN node manages its local cache separately; purge ensures global synchronization.</td></tr><tr><td><strong>Auto Revalidation</strong></td><td>After purge, next requests trigger fresh pulls from the origin.</td></tr></tbody></table>

{% hint style="info" %}
A full purge (`/*`) removes **all cached files** for that resource and should be used only when necessary.
{% endhint %}

### Best Practices

* **Purge only what’s needed.** Avoid full purges to reduce cache refill load.
* **Use specific paths** instead of broad wildcard patterns whenever possible.
* **Automate with API purge** to clear cache after deployments or content updates.
* **Monitor purge logs** to verify completion (see Manage Purge).
* **Coordinate with TTL strategy.** If content changes often, use shorter cache durations.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/purge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
