Dynamic Route for CDN (DCDN) may receive requests whose URLs contain a large number of parameters. If you need to ignore these parameters and retrieve the required content, you can enable the parameter filtering feature. After you enable the feature, DCDN ignores these parameters when it requests and caches resources from the origin servers. This increases the cache hit ratio. This topic describes how to configure the parameter filtering feature.

Background information

  • Parameter filtering is enabled.

    When a DCDN node receives a request, the DCDN node ignores the parameters that follow 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 a large number of parameters, for example, http://alibaba.com/content? a. If these parameters have low priorities and content can be retrieved without these parameters, we recommend that you enable parameter filtering. If you enable the feature, DCDN ignores the parameters that follow the question mark (?) in the request URL when DCDN retrieves resources from the origin server. This increases the 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. DCDN must request the resource from the origin server. When http://www. ****.com/1.jpg? test1 is accessed, the parameters that follow the question mark (?) are ignored because parameter filtering is enabled. Therefore, the requested resource can be retrieved from the cached entry for http://www. ****.com/1.jpg.

    • If a parameter in your HTTP request specifies the file version or other important information, we recommend that you specify the parameter as a retained parameter. You can specify a maximum of 10 retained parameters. If the request URL contains retained parameters, the DCDN node retrieves content from the origin server based on the URL that contains the retained parameters.
  • Parameter filtering is disabled.

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

    A DCDN node may receive a request whose URL contains a question mark (?) and parameters. If these parameters specify important information, we recommend that you disable parameter filtering. After the feature is disabled, the requested resource can be retrieved from the cache only if an exact match occurs. The exact match is performed based on the parameters that follow the question mark (?) in the URL. Exact matches increase the accuracy of cache retrieval. For example, when http://www. ****.com/1.jpg is accessed for the first time, DCDN cannot retrieve the requested resource from the cache. DCDN must 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 if an exact match occurs. This is because the parameter filtering feature is disabled. The exact match is performed based on the parameters that follow the question mark (?) in the URL. As a result, the DCDN node cannot use the cached entry for http://www. ****.com/1.jpg to respond to the request. Instead, the DCDN node must retrieve the requested resource of http://www. ****.com/1.jpg?test1 from the origin server.

Note The URL authentication feature takes precedence over the parameter filtering feature. The authentication information in type A includes the parameters of an HTTP request. Therefore, a DCDN node must verify the encrypted URL of the request before the 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, click Optimization.
  5. In the Parameter Filtering section, turn on Parameter Filtering and configure the Parameter Filtering feature.
    Note After Parameter Filtering is turned on, the parameters that follow the question mark (?) in a request URL are ignored when the node retrieves the resource from the origin server. This increases the cache hit ratio for files.
    Parameter Description
    Reserved Parameters Specify the parameters that you want to retain. You can specify a maximum of 10 parameters. Separate multiple parameters with commas (,). For example, you can enter x for the Reserved Parameters parameter in the http://www.abc.com/a.jpg?x URL.

    Example description:

    A DCDN node sends a request for http://www.abc.com/a.jpg?x to the origin server. In the request, the x parameter is retained. When the DCDN node receives a request whose URL contains the x parameter, the node returns the version of the resource that was previously cached for http://www.abc.com/a.jpg?x.

    Configure parameter filtering
  6. Click OK.