Dynamic Route for CDN (DCDN) may receive a request whose URL contains a question mark (?) and parameters, for example, http://alibaba.com/content?a=10. If these parameters have low priorities and content can still be retrieved without these parameters, you can enable parameter filtering. As a result, DCDN will ignore the parameters following the question mark (?) in the URL of a received request when it requests and caches resources from the origin server. This helps to increase the cache hit ratio. This topic describes how to filter parameters in URLs of requests that DCDN receives.

Background information

  • Parameter filtering is enabled.

    When a DCDN node receives a request, it ignores the parameters following the question mark (?) in the URL. The DCDN node caches only one version of the requested resource.

    • A DCDN node may receive a request whose URL contains a question mark (?) and parameters. We recommend that you enable parameter filtering if these parameters have low priorities because content can still be retrieved without these parameters. Configure the parameter filtering feature to ignore parameters following the question mark (?) in the request URLs. This feature can increase the DCDN cache hit ratio.

      For example, when http://www.****.com/1.jpg is accessed for the first time, DCDN cannot retrieve the requested resource from the cache. It needs to request the resource from the origin server. When http://www.****.com/1.jpg?test1 is accessed, the parameters following the question mark (?) are ignored because parameter filtering is enabled. As a result, the requested resource can be directly retrieved from the cached entry for http://www.****.com/1.jpg.

    • If a parameter contains important information such as the file version, we recommend that you specify the parameter as a retained parameter. You can set up to 10 retained parameters. If the request URL contains a retained parameter, the DCDN node will retrieve content from the origin server based on the URL with the retained parameter.
  • Parameter filtering is disabled.

    A DCDN node caches a unique version of a requested resource for each URL that includes different parameters.

    A DCDN node may receive a request whose URL contains a question mark (?) and parameters. We recommend that you disable parameter filtering if these parameters have important meaning. After the parameter filtering feature is disabled, the requested resource can be retrieved from the cache only if the parameters following the question mark (?) in the URL are an exact match with the previously cached one. Exact matches can increase request accuracy. For example, when http://www.****.com/1.jpg is accessed for the first time, DCDN cannot retrieve the requested resource from the cache. It needs to request the resource from the origin server. When http://www.****.com/1.jpg?test1 is accessed, the DCDN node returns the requested resource from the cache only when the parameters following the question mark (?) in the URL is an exact match with the existing cached entries because parameter filtering is disabled. As a result, the DCDN node cannot respond with the cached entry for http://www.****.com/1.jpg. Instead, the DCDN node needs to retrieve the requested resource of http://www.****.com/1.jpg?test1 from the origin server.

Note The URL authentication feature takes priority over the parameter filtering feature. The authentication information in type A contains the parameters of an HTTP request. Therefore, a DCDN node must verify the encrypted URL of the request before it caches a version of the requested resource. For more information about how to configure URL authentication, see Configure URL authentication.

Procedure

  1. Log on to the Dynamic Route for 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 Configure.
  4. In the left-side navigation pane of the specified domain, click Optimization.
  5. In the Parameter Filtering section, click Modify to configure the parameters as needed.
    Parameter Description
    Parameter Filtering Enable or disable the parameter filtering feature. After this feature is enabled, the parameters following the question mark (?) in a request URL are ignored when the DCDN node retrieves and caches the requested resource from the origin server. This helps to increase the cache hit ratio.
    Reserved Parameters Specify the parameters to be retained. Up to 10 parameters can be specified. Separate multiple parameters with commas (,). Unspecified parameters are not retained. Example: Enter x=1 in the Reserved Parameters field for the URL http://www.abc.com/a.jpg?x=1.

    Example description:

    A DCDN node sends a request for http://www.abc.com/a.jpg?x=1 to the origin server with the x=1 parameter. The DCDN node then retrieves the resource and caches a version of the requested resource. When the DCDN node receives a request whose URL contains the x=1 parameter, it always returns the version of the resource that was previously cached for http://www.abc.com/a.jpg?x=1.

    Parameter Filtering
  6. Click OK.