The parameter filtering feature enables Dynamic Route for CDN (DCDN) to delete the query string in the URL of a request after DCDN receives the request. A query string contains parameters that follow the question mark (?) in a request URL.This feature increases the cache hit ratio and reduces the number of times that Dynamic Route for CDN (DCDN) retrieves resources from the origin. Therefore, this feature reduces data transfer costs and improves the efficiency of content delivery. This topic describes how to configure the parameter filtering feature.

Background information

  • Enable the parameter filtering feature

    A request URL may carry a query string that follows a question mark (?),for example, http://alibaba.com/content?a. If the query string is not essential for retrieving the requested content, we recommend that you enable the parameter filtering feature. After you enable this feature, DCDN automatically deletes the query string that follows the question mark (?)in request URLs. This increases the cache hit ratio.

    For example, the first time you retrieve http://www.****.com/1.jpg, the resource is fetched from the origin server instead of a DCDN node. Next time you retrieve http://www.****.com/1.jpg?test1, DCDN deletes the query string that follows the question mark (?)because the parameter filtering feature is enabled. The request directly hits the cached resource http://www.****.com/1.jpg.

  • Disable the parameter filtering feature

    A request URL may carry a query string that follows a question mark (?). If the query string specifies important content, we recommend that you disable the parameter filtering feature. After the parameter filtering feature is disabled, the query string that follows the question mark (?) in a request URL must exactly match that of the cached version. Exact matches increase the accuracy of content retrieval.

    For example, the first time you retrieve http://www.****.com/1.jpg, the resource is fetched from the origin server instead of a DCDN node. Next time you retrieve http://www.****.com/1.jpg?test1, the query string that follows the question mark (?) in the URL must exactly match that of the cached resource.Otherwise, DCDN does not return the cached version http://www.****.com/1.jpg. Instead, DCDN retrieves the requested resource http://www.****.com/1.jpg?test1 from the origin server.

Note The URL authentication feature has a higher 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 signed URL of the request before the DCDN node 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 DCDN 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 Configure in the Actions column.
  4. In the left-side navigation pane on the details page of the specified domain name, click Optimization.
  5. In the Modify section, Click Parameter Filtering. The following figure shows how to configure parameter filtering. Configure the parameter filtering feature
    Note If you change the filtering mode, the current configuration is cleared.

    You can select Retain Specified Parameters or Delete Specified Parameters for Filter Mode. The following table describes the parameters.

    Filtering mode Parameter Description
    Retain Specified Parameters Parameter Filtering
    • Yes: DCDN deletes the query string that follows the question mark (?) in request URLs. This increases the cache hit ratio.
      Note If you enable Parameter Filtering and do not specify parameters in Retain Specified Parameters, all parameters that follow the question mark (?)are deleted.
    • No: The query string that follows the question mark (?) in a request URL must exactly match that of a cached version. Exact matches increase the accuracy of content retrieval.
    Retain Specified Parameters Specify the parameters that you want to retain. You can specify up to 10 parameters. Separate multiple parameters with commas (,).
    Note If you specify only Retain Specified Parameters, the parameter filtering setting does not take effect. This parameter must be specified together with Parameter Filtering and Retain Parameters in Back-to-origin Parameters.
    Examples:
    • Example 1: Only Parameter Filtering is enabled. Retain Parameters in Back-to-origin Parameters is disabled.

      Original URL: http://test.com/test.png?key1=123&key2=321

      Cached key: http://test.com/test.png

      Back-to-origin URL: http://test.com/test.png

    • Example 2: Parameter Filtering is enabled, and key1 is specified in Retain Specified Parameters.

      Original URL: http://test.com/test.png?key1=123&key2=321

      Cached key: http://test.com/test.png?key1=123

      Back-to-origin URL: http://test.com/test.png?key1=123

    • Example 3: Parameter Filtering and Retain Parameters in Back-to-origin Parameters are enabled.

      Original URL: http://test.com/test.png?key1=123&key2=321

      Cached key: http://test.com/test.png

      Back-to-origin URL: http://test.com/test.png?key1=123&key2=321

    • Example 4: Parameter Filtering and Retain Parameters in Back-to-origin Parameters are enabled. Key1 is specified in Retain Specified Parameters.

      Original URL: http://test.com/test.png?key1=123&key2=321

      Cached key: http://test.com/test.png?key1=123

      Back-to-origin URL: http://test.com/test.png?key1=123&key2=321

    Retain Parameters in Back-to-origin Parameters
    • Yes: DCDN retains the entire query string in a request URL when it forwards the request back to the origin server.
    • No: DCDN retains only the specified parameters in a request URL when it forwards the request back to the origin server.
    Delete Specified Parameters Delete Specified Parameters

    Specifies the parameters that you want to delete. You can specify up to 10 parameters. Separate multiple parameters with space characters.

    Example: Key1 is specified in Delete Specified Parameters and Retain Parameters in Back-to-origin Parameters is enabled.

    Original URL: http://test.com/test.png?key1=123&key2=321

    Cached key: http://test.com/test.png?key2=321

    Back-to-origin URL: http://test.com/test.png?key1=123&key2=321

    Retain Parameters in Back-to-origin Parameters
    • Yes: DCDN retains the entire query string in a request URL when it forwards the request back to the origin server.
    • No: DCDN deletes the specified parameters in a request URL when it forwards the request back to the origin server.
  6. Click OK.