# Header Value Base Cache

The **Header Value Base Cache** feature allows you to **explicitly allow or deny caching when a request contains a specific HTTP header value**.\
This provides precise control over caching behavior for **Dynamic Content Acceleration** resources where certain header values determine whether content should be cached.

{% hint style="info" %}
This feature is available **only for Dynamic CDN Resources**.
{% endhint %}

## How Header Value Base Cache Works

When **Header Value Base Cache** is enabled:

* Medianova CDN inspects incoming requests for the configured **Header** and **Value**.
* If the request matches the defined rule:
  * **Allow** — the response is eligible for caching.
  * **Deny** — the response bypasses the cache and is fetched from the origin.
* Requests that do not match the rule follow the default caching behavior.

This mechanism allows cache decisions to be enforced **conditionally**, rather than only by cache key variation.

## Configure Header Value Base Cache

You can configure this feature from the [**Medianova Control Panel**](https://cloud.medianova.com).

{% stepper %}
{% step %}
**Open the Caching Settings**

Log in to the **Medianova Control Panel**, navigate to **CDN → CDN Resources**, select a **Dynamic CDN Resource**, and open the **Caching** tab.

<figure><img src="/files/5pY3O5y2JduArD85Csdp" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Enable Header Value Base Cache**

Set **Status** to **On**.
{% endstep %}

{% step %}
**Select the Rule Type**

Choose the behavior for matching requests:

* **Allow** — matching requests are cached
* **Deny** — matching requests bypass the cache
  {% endstep %}

{% step %}
**Define the Header Rule**

Enter the rule parameters:

* **Header** — Name of the HTTP request header
* **Value** — Header value to match
  {% endstep %}

{% step %}
**Apply the Configuration**

Select **Submit** to save and apply the changes.
{% endstep %}
{% endstepper %}

* Only **one header value-based rule** can be active at a time.
* Header matching is **exact**; both header name and value must match.
* This feature controls **cache eligibility**, not cache key variation.
* Can be combined with **Header Base Cache** and **Cookie Base Cache** for advanced caching strategies.
* Incorrect use of **Deny** may significantly reduce cache hit ratio.

## Common Use Cases

* Prevent caching when a request contains a debug or preview header
* Allow caching only when a specific feature-flag header is present
* Enforce cache bypass for internal or authenticated traffic
* Control caching behavior based on application-specific headers


---

# 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/dynamic-content-acceleration/advanced-configuration/caching/header-value-base-cache.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.
