# Browser Cache Rule

Browser Cache Rule allows you to control how long different resource types remain cached in the visitor’s browser.

This improves performance by reducing repeated network requests for static or frequently accessed files.

You can manage Browser Cache Rules 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-1).

## **Configure Browser Cache Rules**

Log in to the Medianova Control Panel, select a CDN resource in the CDN section, and navigate to the Caching tab.

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2FW9by0EzWcZOjkhiZlqad%2Fimage.png?alt=media&#x26;token=b197b482-4a74-469f-ab08-83f68ade8305" alt=""><figcaption></figcaption></figure>

{% stepper %}
{% step %}
**Add a Browser Cache Rule**

A dialog opens for creating a new Browser Cache Rule.

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2FExZe9U41Sx0pjOK9dg3M%2Fimage.png?alt=media&#x26;token=f79507c3-c0f5-4fce-8388-41c6edc60520" alt=""><figcaption><p>The 'Add Browser Cache Rule' dialog box appears after clicking Add.</p></figcaption></figure>
{% endstep %}

{% step %}
**Select the Type for the rule.**

Choose how the rule matches content:

* **All Files** — Applies rule to all content.
* **Full Path** — Applies to an exact URL path.
* **Directory** — Applies to all content under a directory (for example: `/images/`).
* **File Extension** — Applies to file types (for example: `.jpg`, `.css`, `.js`).
  {% endstep %}

{% step %}
**Set the Priority**

Select **Priority** to determine the rule evaluation order.
{% endstep %}

{% step %}
**Select the Cache Mode.**

* **Origin** — Uses caching headers from the origin.
* **No Cache** — Disables browser caching.
* **Cache** — Forces caching for a defined duration.
  {% endstep %}

{% step %}
**Select Add to create the rule.**
{% endstep %}

{% step %}
**Configure HTML/JSON Application**

Enable or disable **Apply the HTML/JSON files** to define whether rules also apply to `.html` and `.json` responses.
{% endstep %}

{% step %}
**Select Submit to apply**
{% endstep %}
{% endstepper %}

### Edit a Browser Cache Rule

{% stepper %}
{% step %}
Open the options menu for the rule and select **Edit**.
{% endstep %}

{% step %}
Modify **Type**, **Priority**, or **Cache Mode** as required.
{% endstep %}

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

### Delete a Browser Cache Rule

{% stepper %}
{% step %}
Open the options menu for the rule and select **Delete**.
{% endstep %}

{% step %}
Confirm the deletion to remove the rule.
{% endstep %}

{% step %}
Select **Submit** to apply the update.
{% endstep %}
{% endstepper %}

* Rules are evaluated in order of **Priority**, where smaller numbers indicate higher precedence.
* Browser Cache Rules control **browser-side caching only**, not CDN edge caching.
* The **Apply the HTML/JSON files** toggle affects all rules globally.
* When **Cache Mode = Origin**, browser caching behavior follows origin headers; **No Cache** forces revalidation; **Cache** overrides browser behavior with a fixed duration.

### Best Practices

* Use **file extension** rules to cache static assets like `.js`, `.css`, and `.png` for long durations.
* Use **no cache** mode for frequently updated resources (e.g., `.html`, `.json` APIs).
* Assign **high priority** to specific full path or directory rules if they should override global rules.


---

# 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/browser-cache-rule.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.
