> 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

Error Status Code Cache Expiration defines how long selected HTTP error responses (such as 404 or 500) stay valid in the CDN cache. This reduces repeated requests to the origin when the same error occurs frequently.

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

Select a CDN resource in the CDN section, and navigate to the **Caching** tab.

## Configure Error Status Code Cache Expiration

### **Add an Error Status Code Definition**

Define a cache duration for specific HTTP error codes.

{% stepper %}
{% step %}
**Click Add to Create a New Definition**
{% endstep %}

{% step %}
**Enter the Cache Time**

Enter the duration (in seconds) for how long the selected error code should remain cached.
{% endstep %}

{% step %}
**Enter the Status Code**

Specify one or more HTTP status codes such as **404**, **500**, or **502**.
{% endstep %}

{% step %}
**Submit the Configuration**

Click **Submit** to save the definition.
{% endstep %}
{% endstepper %}

### **Edit an Error Status Code Definition**

Modify the cache time or status code.

{% stepper %}
{% step %}
**Click the Edit Icon Next to the Definition**
{% endstep %}

{% step %}
**Update the Cache Time or Status Code**
{% endstep %}

{% step %}
**Submit the Changes**

Click **Submit** to apply updates.
{% endstep %}
{% endstepper %}

### **Delete an Error Status Code Definition**

Remove a cache rule so that future error responses bypass CDN cache.

## **Behaviour**

* Cached error responses remain valid until the configured cache time expires.
* Deleting a definition does not immediately remove already cached error objects; existing cached content remains until expiration.
* Setting a low cache duration minimizes the risk of serving error responses for extended periods.
* If no definition exists for a status code, the CDN forwards all such responses to the origin without caching.

## **FAQ**

**Does removing a definition purge already cached error responses?**\
No. Existing cached content remains until it expires.

**Can I cache multiple error codes with different durations?**\
Yes. Each status code can have its own cache time.

**What happens if I set the cache time to zero?**\
A value of zero disables caching for that error status code.


---

# 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 dynamically by asking a question.

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

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
