# Prefetch

**Prefetch** refers to the process of proactively fetching and caching specific files from your origin before any user request occurs.\
It warms up CDN caches so that the **first users receive content instantly**, avoiding slow cache misses and offloading your origin server.\
When you initiate a Prefetch, the CDN pulls the file from your origin and caches it across all CDN POPs.\
This is especially effective for the delivery of large static or media files.

{% hint style="info" %}
Prefetch does **not** override existing cache entries. If the file is already cached, a prefetch request will not re-fetch it from origin.

To force a refresh, perform a **Purge** first, followed by **Prefetch**.
{% endhint %}

You can initiate Prefetch operations from the [Medianova Control Panel](https://cloud.medianova.com) or via the [API](/api-documentation/performance-cdn/prefetch.md).

### **When to Use Prefetch**

Use Prefetch to:

* Preload content before a scheduled event, campaign, or content release
* Ensure large static files (e.g., videos, software downloads) load instantly
* Avoid cache-miss latency for the first user(s)
* Offload your origin by serving assets from CDN edge locations

### **How Prefetch Works**

1. You submit one or more file paths via the Medianova Control Panel or [API](https://clients.medianova.com/api-documentation/performance-cdn/prefetch).
2. Medianova CDN initiates an HTTP GET request to your origin for each file.
3. If the file is not already cached, it is fetched and stored across CDN edge locations.
4. The file is then available to be served instantly to users from cache.

{% hint style="info" %}
Prefetch attempts to populate the file across all CDN edge caches to reduce latency globally.
{% endhint %}

### **Prefetch Propagation & Behavior**

When you initiate a Prefetch, the CDN issues an HTTP GET request to your origin and stores the file in cache across all CDN POPs (Points of Presence).\
This ensures that the file is readily available globally, without waiting for actual user traffic to trigger cache population.

Unlike **Purge**, which invalidates cached content, **Prefetch only populates caches if the file is not already cached**. If the file already exists in cache, Prefetch will not re-fetch it from origin.

<table data-header-hidden><thead><tr><th width="256"></th><th></th></tr></thead><tbody><tr><td><strong>Behavior</strong></td><td><strong>Description</strong></td></tr><tr><td><strong>Single-file fetching</strong></td><td>Each Prefetch request targets one specific file path</td></tr><tr><td><strong>CDN-wide propagation</strong></td><td>Files are cached across all POPs</td></tr><tr><td><strong>TTL adherence</strong></td><td>Cache duration respects the file's Cache-Control or configured TTL settings</td></tr><tr><td><strong>Origin-safe</strong></td><td>No effect if the file is already cached unless purged first</td></tr></tbody></table>

**Prefetch Type**

Medianova supports **single-file Prefetch**, which allows fetching and caching a specific file from your origin.

<table data-header-hidden><thead><tr><th width="178"></th><th width="373"></th><th></th></tr></thead><tbody><tr><td><strong>Type</strong></td><td><strong>Description</strong></td><td><strong>Example</strong></td></tr><tr><td><strong>Single File Prefetch</strong></td><td>Fetches and caches one specific file from your origin.</td><td><code>/videos/intro.mp4</code></td></tr></tbody></table>

{% hint style="info" %}
Wildcard operations are not supported.\
Each Prefetch request must target a single file path.
{% endhint %}

#### **Best Practice Highlights**

* Prefetch only frequently accessed static files, such as videos, images, or large downloads.
* Use **Purge + Prefetch** together to refresh caches after file updates.
* Schedule Prefetch operations during **off-peak hours** to minimize origin load.
* Avoid prefetching non-cacheable or dynamic resources.
* Verify operation results in the **Prefetch Logs** section.

{% hint style="info" %}
Monitor your Prefetch efficiency using [MN Logz Analytics](/products/mn-logz/mn-logz-analytics.md).
{% endhint %}


---

# 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/prefetch.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.
