If the URL of your request includes a query string or other variable parameters, CDN may need to retrieve the requested resource from the origin server. In this case, the CDN cache hit rate is reduced. To improve the cache hit rate, you can enable parameter filtering to filter variable parameters in URLs.

Prerequisites

Before you perform the tasks described in this document, make sure that you have completed account registration and real-name authentication with Alibaba Cloud.

Background information

  • If you specify an OSS private bucket as the origin, the required OSSAccessKeyId, Expires, and Signature parameters are automatically added to the URL of the origin request. In such a case, how CDN processes requests to the URL depends on the query string, and these requests may also hit different cache entries. The same is also true when the URL of your request includes the query string. If any change occurs to the query string, CDN needs to retrieve the requested resource from the origin server. This reduces the CDN cache hit rate. To improve the cache hit rate, you can enable parameter filtering.
  • For CDN-based OSS access acceleration, we recommend that you enable the private bucket back-to-origin authorization feature. For more information, see Enable private bucket back-to-origin authorization.

Procedure

  1. Log on to the Alibaba Cloud CDN console.
  2. In the left-side navigation pane, click Domain Names.
  3. On the Domain Names page, find the target domain name and click Manage.
  4. In the left-side navigation pane of the specified domain, click Optimization.
  5. Turn on Parameter Filtering and set Retain Parameters or Ignore Parameters. You can also choose to turn on Retain Origin Parameters based on your business requirements.
  6. Click OK.