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.
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.
When adding an acceleration domain name, default node cache validity rules are added based on different acceleration service types and can be modified as needed.
Node cache rules can be applied to specified file types, folders, and full-path files:
Cache-Controlheader of the origin server.
max-age, the max-age value will be used as the node cache validity.
no-cache/no-store/private, then the CDN node will not cache the resource.
Cache-Control, then the CDN node will not cache the resource.
Note: Some platforms may have the default policy: When a resource is requested for the first time, the request will be forwarded to the origin server and CDN nodes will cache the resource. If the resource is requested again and the node is hit, CDN will add the response header
Cache-Control: no-cache/no-store/privateof the origin server. It defaults to "No".
Note: If force cache is configured as "Yes", node cache validity will be set to the value configured here.
If force cache is configured as "No" and the
Cache-Control field of the origin server is
no-cache/no-store/private, then CDN nodes will not cache resources even the cache validity is configured.
Note: The "No max-age" feature is being upgraded and currently not supported. Please stay tuned for the official launch. If you have configured the rule, please delete it or modify the rule to "All Files".
If there is any legacy node cache validity configuration (i.e., the basic mode), it will be upgraded comprehensively once it is submitted as the advanced mode and can no longer be restored to the basic mode.
The default policies below will be applied if there is no rule configured or hit.
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
www.test.com is as follows:
The actual cache will be as follows:
no-cache/no-store/private, the validity of
www.test.com/abc.jpgis 10 days.
www.test.com/def.phpwill not be cached to nodes.