The node cache validity configuration is updated with an advanced mode, supporting more refined configurations. For more information, please see Node Cache Validity Configuration (New).
The resource cache in Tencent Cloud CDN is triggered by requests. When a user initiates an access request to a resource, if the CDN node receiving the request has not cached the requested resource, it will forward the request to the origin server to pull the resource. After the resource is successfully pulled by the node (with a 2XX status code returned), it will be cached on the node and returned to the user.
You cannot directly manage resources cached on CDN nodes. If you are worried that resources on the origin server will change but CDN nodes will still cache the legacy resources and return them to users, you can configure the node cache rules.
Each cached resource on a CDN node has an expiration time. If the requested cached resource has expired, it will be considered invalid even if the resource is still cached on the node. The node will pull the resource from the origin server again. The node cache rule allows you to configure the cache validity period for resources in a specific type, directory, and path. You can configure these items based on your actual business scenarios.
Log in to the CDN console, select Domain Management on the left sidebar, click Manage on the right of a domain name to enter its configuration page, and open the Cache Configuration tab to find the Node Cache Validity Configuration section.
CDN currently supports configuring node cache validity rules in the following four types:
/testand does not need to end with
/. Different directories should be separated with
/index.html. The full file path and file type can be combined for matching, such as
;to separate different contents, e.g., "Specified file type - jpg;png".
If Advanced Mode is selected and submitted with the rule, then the configuration will be comprehensively upgraded to the advanced mode and cannot be restored to the basic mode. For more information, please see Node Cache Validity Configuration (New).
max-age, the cache validity period for this resource is subject to that configured for the node, rather than the value specified by
private, then the CDN node will not cache the resource.
Cache-Controlfield, then CDN node will not cache resources.
Cache-Control: max-age=600by default.
After it is enabled, CDN will compare the cache validity period of the matched cache rule with the origin server's "max-age" value, and then adopt the smaller value as the cache validity period.
/index.htmlof the origin server is 200 seconds, and the cache validity period configured for CDN is 600 seconds, then the actual cache validity period of the file will be 200 seconds.
/index.htmlof the origin server is 800 seconds, and the cache validity period configured for CDN is 600 seconds, then the actual cache validity period of the file will be 600 seconds.
After it is enabled, if the origin server does not return the
Last-Modifiedfield, CDN will add it by default and change its value once every 10 minutes.
After it is enabled, if a request does not match any cache rules, the origin server will be followed.
The follow origin server switch and the advanced cache validity configuration switch cannot be enabled at the same time.
The node cache validity configurations for the acceleration domain name
cloud.tencent.com is as follows:
The actual cache time will be as follows: