> ## Documentation Index
> Fetch the complete documentation index at: https://gcore-doc-1894.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Ignore the set cookie or query string parameters when caching content on CDN servers

The **Ignore query string** and **Ignore Set-Cookie** options control how query parameters and `Set-Cookie` response headers affect CDN caching. Both are available in the **Cache** section of CDN resource settings.

## Query string setting

The **Ignore query string** option determines how the CDN caches URLs that have query parameters. Query parameters are optional key-value pairs separated by `=` and joined by `&`, appearing at the end of a URL after a `?`:

```
http://cdn.example.com/photo.jpeg?id=6&color=blue
```

When disabled, the full query string is included in the cache key, so URLs with different query parameter values are cached as separate objects.

To enable it in the [Gcore Customer Portal](https://portal.gcore.com):

1. In the left sidebar, select **CDN**, then click the CDN resource to configure.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/p8h1t4ovqAJ5zxbi/images/docs/cdn/cdn-resource-options/cache/ignore-the-set-cookie-or-query-string-parameters-when-caching-content-on-cdn-servers/ignore-query-string-image1.png?fit=max&auto=format&n=p8h1t4ovqAJ5zxbi&q=85&s=d66048a2bbd7817890d463e09020a2c3" alt="CDN resources list" width="1332" height="547" data-path="images/docs/cdn/cdn-resource-options/cache/ignore-the-set-cookie-or-query-string-parameters-when-caching-content-on-cdn-servers/ignore-query-string-image1.png" />
</Frame>

2. In the sidebar, under **Cache**, click **Query string**.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/p8h1t4ovqAJ5zxbi/images/docs/cdn/cdn-resource-options/cache/ignore-the-set-cookie-or-query-string-parameters-when-caching-content-on-cdn-servers/ignore-query-string-image2.png?fit=max&auto=format&n=p8h1t4ovqAJ5zxbi&q=85&s=1b742e69442b1f53bda8126d4d2a4c58" alt="Resource settings — Query string section in the Cache group" width="1400" height="900" data-path="images/docs/cdn/cdn-resource-options/cache/ignore-the-set-cookie-or-query-string-parameters-when-caching-content-on-cdn-servers/ignore-query-string-image2.png" />
</Frame>

3. Enable the **Ignore query string** toggle.

<Warning>Enabling or changing this option may invalidate cached content for URLs with query strings. CDN servers will request those files from the origin again, which can increase origin load.</Warning>

4. Click **Save changes**.

The enabled option has three modes:

| Mode              | Parameters in the list | Other parameters      |
| ----------------- | ---------------------- | --------------------- |
| Ignore all        | —                      | Ignored               |
| Ignore all except | Included in cache key  | Ignored               |
| Ignore only       | Ignored                | Included in cache key |

* **Ignore all** (default). Files with different query parameters are cached as a single object, regardless of parameter values.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/p8h1t4ovqAJ5zxbi/images/docs/cdn/cdn-resource-options/cache/ignore-the-set-cookie-or-query-string-parameters-when-caching-content-on-cdn-servers/ignore-query-string-image3.png?fit=max&auto=format&n=p8h1t4ovqAJ5zxbi&q=85&s=90d7cf9b8dd0981658d4a223dea33f99" alt="Ignore all mode selected" width="777" height="725" data-path="images/docs/cdn/cdn-resource-options/cache/ignore-the-set-cookie-or-query-string-parameters-when-caching-content-on-cdn-servers/ignore-query-string-image3.png" />
</Frame>

The following URLs are cached as a single object because all parameters are ignored:

```
http://cdn.example.com/photo.jpeg?id=6&color=blue
http://cdn.example.com/photo.jpeg?id=1&color=blue
```

* **Ignore all except**. Files with the specified query parameters are cached as separate objects; files with other parameters are cached as a single object.

  Enter each parameter name on a separate line in the text field that appears.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/p8h1t4ovqAJ5zxbi/images/docs/cdn/cdn-resource-options/cache/ignore-the-set-cookie-or-query-string-parameters-when-caching-content-on-cdn-servers/ignore-query-string-image4.png?fit=max&auto=format&n=p8h1t4ovqAJ5zxbi&q=85&s=5a5701e4517718adaa6098a2fabf7376" alt="Ignore all except mode with parameter text field" width="730" height="718" data-path="images/docs/cdn/cdn-resource-options/cache/ignore-the-set-cookie-or-query-string-parameters-when-caching-content-on-cdn-servers/ignore-query-string-image4.png" />
</Frame>

With `id` in the text field: the following URLs are cached as separate objects because the `id` values differ, and the `color` parameter is ignored:

```
http://cdn.example.com/photo.jpeg?id=6&color=blue
http://cdn.example.com/photo.jpeg?id=1&color=blue
```

With `color` in the text field: the following URLs are cached as a single object because the `color` values are the same, and the `id` parameter is ignored:

```
http://cdn.example.com/photo.jpeg?id=6&color=blue
http://cdn.example.com/photo.jpeg?id=1&color=blue
```

* **Ignore only**. Files with the specified query parameters are cached as a single object; files with other parameters are cached as separate objects.

  Enter each parameter name on a separate line in the text field that appears.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/p8h1t4ovqAJ5zxbi/images/docs/cdn/cdn-resource-options/cache/ignore-the-set-cookie-or-query-string-parameters-when-caching-content-on-cdn-servers/ignore-query-string-image5.png?fit=max&auto=format&n=p8h1t4ovqAJ5zxbi&q=85&s=92a7a5d01f54f74251eb3d48e9f19613" alt="Ignore only mode with parameter text field" width="719" height="715" data-path="images/docs/cdn/cdn-resource-options/cache/ignore-the-set-cookie-or-query-string-parameters-when-caching-content-on-cdn-servers/ignore-query-string-image5.png" />
</Frame>

With `id` in the text field: the following URLs are cached as a single object because the `id` values are ignored, and the `color` values are the same:

```
http://cdn.example.com/photo.jpeg?id=6&color=blue
http://cdn.example.com/photo.jpeg?id=1&color=blue
```

With `color` in the text field: the following URLs are cached as separate objects because the `color` values are ignored, and the `id` values differ:

```
http://cdn.example.com/photo.jpeg?id=6&color=blue
http://cdn.example.com/photo.jpeg?id=1&color=blue
```

## Set-Cookie setting

By default, the CDN caches files with different `Set-Cookie` header values as separate objects. This means multiple cached copies of the same content can accumulate for different cookie values, reducing the cache hit ratio.

The **Ignore Set-Cookie** option changes this behavior: files are cached as a single object regardless of the `Set-Cookie` header value. Gcore recommends enabling this option for the best cache hit ratio.

To enable it, open the CDN resource settings (same page as the **Query string** option), enable the **Ignore Set-Cookie** toggle in the **Cache** section, then click **Save changes**.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/p8h1t4ovqAJ5zxbi/images/docs/cdn/cdn-resource-options/cache/ignore-the-set-cookie-or-query-string-parameters-when-caching-content-on-cdn-servers/ignore-query-string-image6.png?fit=max&auto=format&n=p8h1t4ovqAJ5zxbi&q=85&s=bc8320310076f506b3e11afca2db3924" alt="Set-Cookie section with Ignore Set-Cookie toggle" width="713" height="350" data-path="images/docs/cdn/cdn-resource-options/cache/ignore-the-set-cookie-or-query-string-parameters-when-caching-content-on-cdn-servers/ignore-query-string-image6.png" />
</Frame>
