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.
- 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.
- Log on to the Alibaba Cloud CDN console.
- In the left-side navigation pane, click Domain Names.
- On the Domain Names page, find the target domain name and click Manage.
- In the left-side navigation pane of the specified domain, click Optimization.
- 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.
- Click OK.