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