Node cache validity configuration refers to a set of validity rules the CDN cache nodes should follow when caching your business contents.
All resources cached on CDN nodes have validity. For unexpired resources, when a request reaches the node, the node will directly return the requested resources to the user, so as to speed up the resource acquisition. For expired resources, the node will forward the user request to the origin server. If the resources have been updated on the origin server, they will be reacquired, cached to the node, and then returned to the user; otherwise, only the resource validity will be updated on the node. A proper cache validity can effectively improve the resource hit rate and lower the origin-pull rate, reducing bandwidth usage.
You can configure the browser cache validity on the console. For more information, please see Browser Cache Validity Configuration.
You can configure the cache validity for resources based on the directory, file path, file type. For more information, see Node Cache Validity Configuration (New).
When you set "No Cache" for a file, the file will not be cached on CDN nodes. Each time you request the file, CDN nodes will pull it from the origin server directly.
CDN allows you to set a cache validity period and whether to ignore query string, ignore case, follow origin server and enable heuristic cache for various file types. By using these cache rules properly, you can effectively improve the hit rate with a lower origin-pull rate and bandwidth usage. For details, see Cache Configuration and Node Cache Validity Configuration (New).
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.
If 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.When multiple cache rules are set, the ones at the bottom of the list have higher priority. For example, if a domain name is configured as follows:
All files - 30 days
.php .jsp .aspx - 0 seconds
.jpg .png .gif - 300 seconds
/test/*.jpg - 400 seconds
/test/abc.jpg - 200 seconds
If the domain name is www.test.com
, and the resource is www.test.com/test/abc.jpg
, the matching rule will be as follows:
The final cache validity is subject to the last matching result, so it will be 200 seconds.
You can check the X-Cache-Lookup of the HTTP response header.
X-Cache-Lookup: Hit From MemCache
X-Cache-Lookup: Hit From Disktank
X-Cache-Lookup: Cache Hit
If any of the above is returned, a cache hit occurs, otherwise it is a cache miss.
No. The cache on CDN cache nodes will not be updated in real time.
Was this page helpful?