The node cache validity configuration is updated with an advanced mode, supporting more refined configurations. For more information, see Node Caching Rule Configuration.
The resource cache in Tencent Cloud CDN is triggered by requests. If the CDN node receiving the user 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 change but CDN nodes still cache the legacy resources and return them to users, you can configure 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.
Note:Currently, a file up to 32 GB can be cached, otherwise, the resources will be pulled from the origin server.
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:
;
, i.e., jpg;css
./test
and 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 /test/*.jpg
.Configuration limitations:
Note: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, see Node Caching Rule Configuration.
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.
Max-Age
configured for /index.html
of 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.Max-Age
configured for /index.html
of 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.Note:After it is enabled, if the origin server does not return the
Last-Modified
field, 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.
Note: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-Control
, the Cache-Control
will 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
are as follows:
The actual cache validity will be as follows:
/test/def.jpg
file./test/1.png
file.
Was this page helpful?