> For the complete documentation index, see [llms.txt](https://clients.medianova.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/caching/stale-cache.md).

# Stale Cache

Serve stale cached content when the origin returns specific HTTP error responses or enters an Updating state

**Stale Cache** allows the CDN to serve an expired cached object when the origin is unavailable or returns a configured error condition. This provides a cached fallback during temporary origin failures without requiring the CDN to retrieve a new object.

You can manage Stale Cache in the [Medianova Control Panel](https://cloud.medianova.com) or via the [API](https://clients.medianova.com/api-documentation/performance-cdn/caching#put-api-v1-cdn-organization_uuid-resource-resource_uuid-6).

{% hint style="info" %}
Stale content can be served only when a previously cached version of the requested object exists at the edge.
{% endhint %}

## Configure Stale Cache

{% stepper %}
{% step %}

### Open Stale Cache

Open your CDN Resource and select **Caching**.

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2FWnl3SJnQInORLh0yudhs%2Fimage.png?alt=media&amp;token=a8c36a45-d148-4fe7-8103-cee6c3624ee8" alt=""><figcaption></figcaption></figure>

Locate **Stale Cache**.
{% endstep %}

{% step %}

### Select Stale Cache Triggers

Under **Stale Cache Triggers**, select the conditions that allow the CDN to serve stale cached content.

Available triggers include:

* `error` — An error occurs while communicating with the origin.
* `timeout` — The origin does not respond within the configured timeout.
* `invalid_header` — The origin returns an invalid response header.
* `http_403` — The origin returns **403 Forbidden**.
* `http_404` — The origin returns **404 Not Found**.
* `http_429` — The origin returns **429 Too Many Requests**.
* `http_500` — The origin returns **500 Internal Server Error**.
* `http_502` — The origin returns **502 Bad Gateway**.
* `http_503` — The origin returns **503 Service Unavailable**.
* `http_504` — The origin returns **504 Gateway Timeout**.
* `updating` — Stale content can be served while the cached object is being updated.

When any selected trigger occurs, the CDN can serve an available stale cached version of the requested object.
{% endstep %}

{% step %}

### Save the Configuration

Select **Save** in the pending changes bar.

Review the pending changes and confirm the update to apply the configuration to the CDN Resource.
{% endstep %}
{% endstepper %}

## Stale Cache Behavior

Stale Cache uses an existing expired cached object as a fallback when one of the configured triggers occurs.

The CDN does not create a stale object when no cached version exists. In that case, Stale Cache cannot provide a cached fallback for the request.

When the configured stale condition no longer applies, normal cache behavior resumes according to the resource's caching configuration.

{% hint style="warning" %}
Stale Cache can keep content available during temporary origin failures, but the response may contain an older version of the object. Select triggers according to the freshness requirements of your content.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/caching/stale-cache.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
