> 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/query-string-caching.md).

# Query String Caching

Configure how URL query parameters affect cache keys and cached content variants on Medianova CDN edge servers.

**Query String Caching** determines whether query parameters are included in cache-key evaluation. You can cache different query string variations separately, exclude query parameters from the cache key, or control which parameters are considered when identifying cached content.

You can configure Query String Caching 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-2).

{% hint style="warning" %}
Exclude query parameters from the cache key only when they do not affect the response content. Ignoring parameters that produce different responses can cause requests to receive an incorrect cached variant.
{% endhint %}

## Query String Caching Modes

Query String Caching supports three modes:

<table><thead><tr><th width="142.5">Mode</th><th>Behavior</th></tr></thead><tbody><tr><td><strong>On</strong></td><td>Includes query strings in cache-key evaluation, allowing different query string combinations to create separate cached variants.</td></tr><tr><td><strong>Off</strong></td><td>Excludes query strings from the cache key. Requests for the same URL path share the same cache entry regardless of query parameters.</td></tr><tr><td><strong>Request URI</strong></td><td>Uses the complete request URI, including query parameters, when constructing the cache key.</td></tr></tbody></table>

## Configuration Steps

{% stepper %}
{% step %}

### Open Query String Caching

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%2FLcpeRdpBR2julTE65TBc%2Fimage.png?alt=media&#x26;token=c6217a99-42d1-420c-b0e6-f39a63862fa0" alt="Query String Caching settings in the Medianova Control Panel"><figcaption><p>Query String Caching configuration.</p></figcaption></figure>
{% endstep %}

{% step %}

### Select the Caching Mode

Under **Query String Caching**, select one of the following:

* **On** – Cache different query string combinations separately.
* **Off** – Ignore query strings when identifying cached content.
* **Request URI** – Use the complete request URI when constructing the cache key.
  {% endstep %}

{% step %}

### Configure Parameter Filtering

If required, configure one of the following options:

* **Ignore Specific Query Strings** – Exclude specified query parameters from cache-key evaluation while retaining other parameters.
* **Cache Specific Query Strings Only** – Include only specified query parameters in cache-key evaluation and ignore all remaining parameters.
  {% 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 Key Behavior

Query String Caching determines how requests with different query parameters are associated with cached objects.

### On

When **On** is selected, query strings are included in cache-key evaluation.

For example, the following requests can create separate cached variants:

* `/image.jpg?width=400`
* `/image.jpg?width=800`

This mode is suitable when query parameters affect the response content.

### Off

When **Off** is selected, query strings are excluded from the cache key.

For example, the following requests map to the same cache entry:

* `/image.jpg?source=homepage`
* `/image.jpg?source=newsletter`

This mode is suitable when query parameters do not affect the response content.

### Request URI

When **Request URI** is selected, the complete request URI, including its query string, is used when constructing the cache key.

This mode preserves query parameters as part of the request URI used for cache identification.

## Parameter Filtering

Parameter filtering provides additional control over which query parameters contribute to the cache key.

### Ignore Specific Query Strings

Excludes selected query parameters from cache-key evaluation.

For example, if `utm_source` is ignored:

* `/product.jpg?size=large&utm_source=email`
* `/product.jpg?size=large&utm_source=social`

Both requests use the same cache key because the `utm_source` parameter is excluded.

### Cache Specific Query Strings Only

Includes only selected query parameters in cache-key evaluation.

For example, if only `size` is included:

* `/product.jpg?size=large&campaign=summer`
* `/product.jpg?size=large&campaign=winter`

Both requests use the same cache key because `campaign` is excluded.

## Important Notes

* Query String Caching affects cache-key evaluation and the number of cached variants created for a resource.
* Including unnecessary query parameters can increase cache fragmentation and reduce cache efficiency.
* Excluding parameters that affect response content can result in incorrect cached responses.
* Parameter filtering should be configured according to the origin application's query parameter behavior.


---

# 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/query-string-caching.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.
