> 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/error-status-code-cache-expiration.md).

# Error Status Code Cache Expiration

Configure how long selected HTTP error responses remain cached on Medianova CDN edge servers.

**Error Status Code Cache Expiration** allows you to define cache durations for specific HTTP error status codes. Caching error responses can reduce repeated requests to the origin server, particularly when the same error is returned frequently.

You can configure Error Status Code Cache Expiration through the [Medianova Control Panel](https://cloud.medianova.com) or the [API](https://clients.medianova.com/api-documentation/performance-cdn/caching#put-api-v1-cdn-organization_uuid-resource-resource_uuid-4).

{% hint style="warning" %}
Cached error responses may continue to be served after the underlying issue has been resolved. Use cache durations appropriate to the error condition, particularly for temporary server errors.
{% endhint %}

## Configuration Steps

{% stepper %}
{% step %}

### Open Error Status Code Cache Expiration

Open your CDN Resource in the Medianova Control Panel and select **Caching**.

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2F6frge9UyphTz1ekrrJOj%2Fimage.png?alt=media&#x26;token=8326e122-112f-478b-a399-b2434a83ecc1" alt="Error Status Code Cache Expiration configuration in the Medianova Control Panel"><figcaption><p>Error Status Code Cache Expiration configuration.</p></figcaption></figure>
{% endstep %}

{% step %}

### Add a Rule

Under **Error Status Code Cache Expiration**, select **Add rule**.

The **Add Error Status Code Cache Expiration** dialog opens.
{% endstep %}

{% step %}

### Configure Cache Time

Enter the desired **Cache Time** and select the corresponding time unit.

This value determines how long matching HTTP error responses remain cached at the CDN edge.
{% endstep %}

{% step %}

### Select Status Codes

Under **Status Codes**, select the HTTP error status codes to which the configured cache duration should apply.

You can select multiple supported status codes within the same rule.
{% endstep %}

{% step %}

### Add the Rule

Select **Add rule**.

The configured rule appears in the **Error Status Code Cache Expiration** table.
{% 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 %}

## Cache Behavior

### Caching Error Responses

When the origin returns an HTTP error status code covered by a configured rule, the CDN can cache the error response for the specified duration.

Subsequent requests for the same cacheable resource can receive the cached error response without requiring another request to the origin until the cache duration expires.

For example, if a **404 Not Found** response is configured with a cache duration of 5 minutes, the CDN can reuse that response during the configured period instead of repeatedly requesting the missing object from the origin.

### Cache Expiration

After the configured cache duration expires, the CDN can request the resource from the origin again.

If the origin continues to return the configured error status code, the response can be cached again according to the applicable rule.

If no rule is configured for a status code, this feature does not assign a cache duration to that response.

## Important Notes

* Caching **404 Not Found** responses can reduce repeated origin requests for missing resources.
* Use short cache durations for temporary errors, such as **500 Internal Server Error**, **502 Bad Gateway**, **503 Service Unavailable**, and **504 Gateway Timeout**.
* Removing or modifying a rule does not automatically purge previously cached error responses. Existing responses remain subject to their current cache expiration.
* Error Status Code Cache Expiration controls the caching of HTTP error responses. It is different from Stale Cache, which allows previously cached content to be served when configured origin error conditions occur.


---

# 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/error-status-code-cache-expiration.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.
