After you enable the parameter filtering feature, Alibaba Cloud CDN can delete parameters that follow the question mark (?) from request URLs. This improves the cache hit ratio, reduces the number of requests that are redirected to the origin server, reduces the costs of back-to-origin data transfer, and accelerates content delivery. When you enable the parameter filtering feature, you can specify the parameters that you want Alibaba Cloud CDN to delete.

Overview

The following figure shows three methods that you can use to filter URL parameters: ignore all URL parameters, retain specified URL parameters and ignore other URL parameters, and retain all URL parameters.
Note Authenticating signed URLs has a higher priority than parameter filtering. For HTTP requests whose URLs are signed by using type A signing, their signed URLs contain the query string. Alibaba Cloud CDN must verify signed URLs before it can perform parameter filtering. Parameter filtering is performed only on signed URLs that have passed the authentication. Therefore, parameter filtering does not affect the results of authenticating signed URLs. In addition, the requested resources are cached on CDN nodes based on the hash keys that are generated by parameter filtering. For more information about authenticating with URL signing, see URL signing.
Delete parameters
Feature Description
Parameter Filtering

After you enable Parameter Filtering, Alibaba Cloud CDN deletes the parameters that follow the question mark (?) from request URLs.This increases the cache hit ratio.

For example, the first time http://www.****.com/1.jpg is visited, the requested resource is not cached on CDN nodes. Therefore, Alibaba Cloud CDN must retrieve the requested resource from the origin server. When http://www.****.com/1.jpg?test1 is visited, the URL parameters that follow the question mark (?) are deletedbecause parameter filtering is enabled. The request can directly hit the cached resource of http://www.****.com/1.jpg.

Parameter Filtering+Delete Parameters After you enable Parameter Filtering and specify the parameters that you want to delete, the specified parameters that follow the question mark (?)are deleted. Other parameters are retained.
Retain Origin Parameters
  • If you enable Retain Origin Parameters, Alibaba Cloud CDN retains all parameters that follow the question mark (?)in request URLs during the back-to-origin routing process.
  • If you do not enable Retain Origin Parameters, Alibaba Cloud CDN deletes the specified parameters from request URLs during the back-to-origin routing process.

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 domain name that you want to manage and click Manage in the Actions column of the domain name.
  4. In the management pane of the domain name, click Optimization.
  5. In the Parameter Filtering (Delete Specified Parameters) section, click Modify.
  6. Set the following parameters based on the instructions.
    Parameter filtering
    Parameter Description
    Parameter Filtering Turn on Parameter Filtering.
    Delete Parameters Specify the parameters that you want to delete based on your business requirements.

    You can specify at most 10 parameters to be deleted. Separate multiple parameters with commas (,). For example, for the URL http://www.abc.com/a.jpg?x, set Delete Parameters to x.

    Retain Origin Parameters Turn on or turn off Retain Origin Parameters based on your business requirements.
    • If you enable Retain Origin Parameters, Alibaba Cloud CDN retains all parameters that follow the question mark (?)in request URLs during the back-to-origin routing process.
    • If you do not enable Retain Origin Parameters, Alibaba Cloud CDN deletes the specified parameters from request URLs during the back-to-origin routing process.
  7. Click OK.

Related API operations

BatchSetCdnDomainConfig