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 validity. 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 switch to 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
If Advanced Mode is selected for a rule, the rule will be upgraded comprehensively as the advanced mode once it is submitted and can no longer be restored to the basic mode. For more information, please see Node Cache Validity Configuration (New).
After it is enabled, CDN will compare the cache validity of the matched cache rule with the origin server's "max-age" value, and then adopt the smaller value as the cache validity.
/index.htmlof the origin server is 200 seconds, and the cache validity configured for CDN is 600 seconds, then the actual cache validity of the file will be 200 seconds.
/index.htmlof the origin server is 800 seconds, and the cache validity configured for CDN is 600 seconds, then the actual cache validity 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.
If no feature is enabled, no rule is configured or matches requests, the default policies will be applied:
Cache-Controlwill be followed.
Cache-Control, then the resource cache validity on nodes will be 600 seconds.
The node cache validity configurations for the acceleration domain name
cloud.tencent.com is as follows:
The actual cache validity will be as follows: