Documentation Cache Settings Cache While Ignoring Query Strings

Cache While Ignoring Query Strings

Last update:2026-07-13 18:21:38

When users request content from your website, they may include special parameters in the URL after a question mark to support specific logic, for example:

http://domain/1.jpg?version=1

By default, the Atomile CDN platform caches the full request URL on CDN servers. This means that different query string values after the question mark result in different cached objects. A user request must exactly match the cached URL to result in a cache hit on the CDN servers.

When many query string parameters are used, the number of cached objects on CDN servers can increase significantly, which may reduce the cache hit ratio. This can lead to more origin requests, higher response latency, increased origin load, and higher operating costs.

If your website returns the same content for URLs that have the same path before the question mark but different query string parameters, we recommend configuring the CDN platform to ignore some or all query string parameters for caching. This can improve the CDN cache hit ratio, enhance the user experience, and reduce both origin load and operational costs.

How to Configure Cache While Ignoring Query Strings

  1. Log in to the Atomile Console and select the appropriate product.
  2. Go to Configuration, locate the domain you want to configure, and click Edit Configuration at the top or the Edit button to the right of the domain.
  3. On the configuration page, find Query String under Cache Optimization, and click Add.
  4. On the rule editing page, configure the following options as needed.

Effective Range

The Atomile CDN platform provides the following options for the effective range. You can use them to define which requests the rule applies to.

Parameter Description
All Requests This rule applies to all requests for the associated domain.
Specified File Types This rule applies to requests for specified file types. You can choose from the listed file types or enter custom file types in this field. Separate multiple file types with ;, for example, ace;aac.
Specified URI You can configure the rule for a specific URI request. Only one URI can be configured per rule.
Do not include http:// or https:// in the input. Enter only the URI part. For example, if the complete URL is https://domain/browse/index.html, enter only /browse/index.html.
The configured URI cannot include ?.
Specified Directory This rule applies to all requests for specified directories. Each directory must begin and end with / and can include letters, numbers, and certain special characters, such as underscores (_), hyphens (-), percent signs (%), and dots (.). For example, /file/1%1/ applies to requests for http://domain/file/1%1/ and all files under that directory.
Please separate multiple directories with line breaks.
URL Regular Expression You can also directly enter a regular expression. It does not need to begin with /. The platform automatically prefixes the URL with ^https?://[^/]/. For example, .*.jpg$ indicates that requests for JPG files across all domains associated with this rule match this policy.

After configuring the Effective Range, you can define whether the query string should be included in the CDN cache key and response matching logic. The Atomile CDN platform provides the following three options:

Ignore All Query String - Cache Without Query String Parameters

This option ignores the query string in the request URL. Even if the parameters after the question mark differ, CDN servers cache only the URL path before the question mark. Requests with different query strings therefore hit the same cached object on the CDN servers.

You can also configure whether the query string should be ignored when the CDN server needs to fetch content from the origin due to a cache miss.

  • If you select Yes, the request sent from the CDN server to the origin also ignores the query string.
  • If you select No, the CDN server includes the query string when requesting the origin.

Keep All Query String - Cache With All Query String Parameters

This option does not ignore the query string in the request URL. The full URL, including all query string parameters, is used as the cache key on CDN servers. If any query string parameter value changes, the CDN servers cache a separate object. Requests with different query string values hit different cached objects.

When the CDN server fetches the content from the origin, it keeps all query string parameters in the request URL.

Keep Some Query String - Cache With Selected Query String Parameters

Like the previous option, this setting does not completely ignore the query string when caching and responding to user requests. However, you can define which query string parameters are used as cache key criteria. Only differences in the selected parameters create separate cached objects on the CDN servers.

You can choose one of the following modes:

  • Keep Some Query String: only the specified query string parameters are used as cache criteria.
  • Delete Some Query String: the specified query string parameters are excluded, and all remaining parameters are used as cache criteria.

You can define multiple parameters separated by semicolons, for example, name;year.

In the Back-to-Origin Parameter Setting field, you can also define how query string parameters are handled when the CDN fetches content from the origin. The available options are:

  • Keep All Query String
  • Keep Some Query String
  • Delete Some Query String

These options have the same meanings as described above. If you enter - when configuring Delete Some Query String, the request URL sent to the origin contains no query string parameters. Multiple parameters should be separated by semicolons.

Ignore Case Sensitivity

If you select Yes in this field, the configured Effective Range ignores case sensitivity. In other words, two request URLs that differ only in letter case for the field defined in Effective Range match the same rule.

For example, if you configure http://domain/a.jpg?version=1 to ignore the query string for caching, then http://domain/A.jpg?version=1 is also matched by the same rule.

If you select No, case sensitivity is preserved. The rule applies only to requests that exactly match the case defined in Effective Range.

The default value of this field is Yes.

Priority

In the Priority field, you can specify the priority of this rule. The system matches rules based on the user request. If multiple rules apply, the one with the higher priority is applied first.

After completing the configuration, click OK, and then click Next to submit your settings. To minimize potential disruption to your production environment, we strongly recommend performing a Pre-deploy test in a staging environment. This important step ensures that your configuration is correct before it goes live.

After you confirm that the settings are correct, click Deploy Now to apply them in the live environment. The configuration typically takes effect within 3 to 5 minutes. For more information about pre-deployment testing and validation, refer to Deploy the Configurations to Staging Environment for Validation.

Notes

If you configure the CDN not to ignore query string parameters for caching, a separate cached object is created for every different query string value. This may reduce the cache hit ratio and increase the number of requests sent to the origin server.

Therefore, if your business logic does not require all query string parameters to be part of the cache key, we recommend ignoring query string parameters for caching or using only selected parameters as cache criteria.