Ignore Query String Configuration

Last updated: 2019-09-25 20:11:05

PDF

CDN provides an Ignore Query String switch, which allows you to control whether to filter the parameters after "?" in user's request URL during caching. You can use this feature for flexible versioning or token-based authentication.

If different parameters in your resource URL represent the same content, it is recommended to enable the ignore query string feature to effectively improve the cache hit rate.

Configuration Guide

  1. Log in to the CDN Console and click Domain Management on the left sidebar to enter the management page.
  2. In the list, find the row of the domain name to be edited and click Manage in the operation column.
  3. Click the Access Control tab and configure the ignore query string feature in the Ignore Query String module.

    If your accelerated business type is download, video on-demand, or live video broadcasting, the ignore query string feature is enabled by default. If the type is static content, it is disabled by default.

Configuration Case

When CDN caches resources on the node storage structure, it looks up the stored resources based on the cache_key as an index.

  1. If the configuration is as follows:
    • User A requests a resource with URL http://www.test.com/1.jpg?version=1.1. When a node stores the resource, the corresponding cache_key is www.test.com/1.jpg. with the parameters after "?" ignored.
    • User B requests a resource with URL http://www.test.com/1.jpg?version=1.2, which will also be looked up with cache_key as www.test.com/1.jpg. Therefore, the same content as requested by user A can be directly hit.
  2. If the configuration is as follows:
    • User A requests a resource with URL http://www.test.com/1.jpg?version=1.1. When a node stores the resource, the corresponding cache_key is www.test.com/1.jpg?version=1.1 with the parameters after "?" not ignored.
    • User B requests a resource with URL http://www.test.com/1.jpg?version=1.2, which will be looked up with cache_key as www.test.com/1.jpg?version=1.2. As there is no hit, the corresponding content will be obtained from the origin server for caching.