百度智能云

All Product Document

          CDN

          Configure Ignoring Paramters

          Overview

          HTTP request parameters refer to the part after the "?" in the URL. You can use Ignore parameter caching to flexibly control whether request parameters take part in the resource caching and search and improve the CDN cache hit rate.

          Considerations

          When you enable this feature, you can ignore URL parameters for caching and improve file cache hit rate. It is also possible to skip important key information. You can set it reasonably according to your business requirements.

          Configuration ignoring parameters

          1. Log in to CDN Management Console to enter the “Content Distribution Network (CDN)“ page.
          2. Click Domain Name - Management on the left navbar.
          3. Enter the domain name management page and click Management in the operation column of the target domain name.
          4. Enter the "CDN Domain Name Details" page, and select the Cache configuration tab in the navbar at the top of the page.
          5. Click Edit in the Ignore parameters module and follow the descriptions given in the table below to set the ignoring URL parameters.

            Description of ignoring URL parameter status
            Ignore allWhen the CDN generates and searches for the resource cache, the part after the ? in the URL is removed. That is, requests with the same PATH but different request parameters are taken as the same resource by the CDN.
            • If the distributed content is a static resource, and the HTTP request parameters in the URL do not affect the response content, enabling this feature can effectively increase the file cache hit rate and improve the distribution efficiency.
            • If the parameters have important meanings, such as file version information, etc., it is recommended to set "Retention parameters". You can also set multiple retention parameters. If the request contains any "Retention parameter", the retention parameter is returned to the origin server, and the unspecified parameters are not retained.
            Do not ignoreAll HTTP request parameters takes part in the storage and search of the cache. URLs with different request parameters are taken as different resources even if the PATH part is the same.
            Retain the specified parameters The specified parameters take part in the storage and search of the cache.
            Ignore the specified parametersExcept for the specified part of the parameters, other parameters take part in the storage and search of the cache.
          6. You can set the retention parameters, and click Save after configuration to complete the configuration of the ignoring parameters.

          Note: Retain/ignore the specified parameters. Enter a maximum of 10 parameters. Multiple parameters are separated by commas, and unspecified parameters are not retained.

          Configuration example

          For example, we set http://www.bcecdn.com/1.jpg?test=1 to request the URL to the CDN node:

          • Configure Ignore all:
          • When the user accesses http://www.bccdn.com/1.jpg for the first time, the CDN has no cache and directly accesses the data via the origin server. When the user accesses http://www.bccdn.com/1.jpg ?test=1 for the second time, the parameters after the "?" do not need to match because the parameter filtering is enabled, i.g., it can hit the CDN cache http://www.bccdn.com/1.jpg.
          • Configure the retention paramter test:

            • Requests with different test parameters are taken as different resources even if the PATH part is the same. For example, requests http://www.bccdn.com/1.jpg?test=1 and http://www.bccdn.com/1.jpg?test=2 are taken as different resources by CDN.
            • Other unspecified retention parameters are ignored. For example, request http://www.bccdn.com/1.jpg?class=1 and http://www.bccdn.com/1.jpg? class=2 are taken as the same resource by CDN.
          • Configure the ignoring specified parameter test:
          • If the two requests differ only in their test parameters, they are still taken as the same resource by the CDN. For example: http://www.bccdn.com/1.jpg?test=1 and http://www.bccdn.com/1.jpg?test=2 are taken as the same resource by CDN.
          • Requests with different parameters except test are taken as different resources. For example, the requests http://www.bccdn.com/1.jpg?class=1 and http://www.bccdn.com/1.jpg?class=2 are taken as different resources by CDN .
          • If you select Do not ignore, all requests with different HTTP request parameters are taken as different resources by CDN.
          Previous
          Configure URI Rewriting
          Next
          Mobile Access Configuration