Tencent Cloud CDN uses the
Key-Value format to map resources during caching, where
Key is the cache key and a unique identifier of the cached resource. By configuring cache key rules, you can configure the Ignore Query String and Cache Ignore URL Case features for the content of different file types to optimize cache keys.
When a user accesses the resource through a URL, the access request may carry some parameters for special purposes. For example, the following URLs are used to represent two different images:
In this scenario, you need to disable Ignore Query String and use a complete URL as the cache key to cache images and distinguish between resources.
If you use the timestamp signature parameter for access authentication in an audio/video scenario:
In this scenario, you need to enable Ignore Query String and use the URL part before "?" (i.e.,
http://cloud.tencent.com/1.mp4) as the cache key. The node will then only cache one resource, and the cache can be directly hit through signature authentication even if the timestamp signature keeps changing.
If the letter case of resource URL paths is relevant to the resource content in your business, you can disable "Cache Ignore URL Case".
If the letter case of resource URL paths is irrelevant to the resource content in your business, you can enable "Cache Ignore URL Case" to improve the hit rate.
The platform is being upgraded and Cache Ignore URL Case cannot be enabled currently.
Log in to the CDN console, select Domain Management on the left sidebar, and click Manage on the right of a domain name to enter its configuration page. Select the Cache Configuration tab to find the Cache Key Rule Configuration section.
When adding an acceleration domain name, the Ignore Query String is enabled or disabled by default based on different acceleration business types.
You can add cache rules as needed.
You can click Modify to modify the added cache key rules.
The default rules support modifying Ignore Query String and Cache Ignore URL Case configurations, while the type and content cannot be modified.
You can click Delete to delete the added cache key rules (except the default ones).
If the cache key rule configuration of the acceleration domain name
www.test.com is as follows:
Then the actual access will be as follows:
A client accessed the resources
www.test.com/abc.JPG?version=1&colour=red, the two requests arrived at the CDN node X, on which the resources are not cached.
abc.jpg, and the image will be cached on the CDN node X. As Ignore Query String is enabled and Filter All is selected, the URL part
www.test.com/abc.jpg before "?" will be used as the cache key.
www.test.com/abc.JPG?version=1&colour=red, and as the Cache Ignore URL Case is disabled, the cached resource
www.test.com/abc.jpg will not be hit, the origin server will be pulled for the image
abc.JPG, the image will be cached on the CDN node X, and
www.test.com/abc.JPG will be used as the cache key.