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 open 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 business types and can be modified as needed.
Node cache validity rules support caching by specified file type, folder, and full-path file.
Cache-Control
header of origin server.Cache-Control
field exists in the corresponding HTTP response header of the origin server, then:Cache-Control
field is max-age
, the CDN node cache validity will be the max-age
value.Cache-Control
field is no-cache
, no-store
, or private
, the CDN node will not cache resources.Cache-Control
field does not exist in the corresponding HTTP response header of the origin server, the CDN node will not cache resources.Cache-Control: max-age=600
by default.Cache-Control: no-cache/no-store/private
of the origin server (No is ticked by default).Cache-Control
field of the origin server is no-cache
, no-store
, or private
, CDN nodes will not cache resources even though the cache validity is configured.Note:
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 node cache validity configurations for the acceleration domain name www.test.com
is as follows:
The actual cache will be as follows:
www.test.com/abc.jpg
is 10 days, even though the Cache-Control
field of the origin server is no-cache
, no-store
, or private
.www.test.com/def.php
will not be cached to the node.
Was this page helpful?