CDN is capable of configuring basic cache. Cache validity can be configured according to rules such as specified service types, directories, and specific URLs to regularly purge resources cached on nodes, pull the latest resources from the origin server, and cache them again.
In addition, CDN can purge cache for specified URLs or directories in batches:
Last-Modifyinformation of the resource will be pulled from the origin server. If it is the same as that of the cached resource, the cached resource will be directly returned; otherwise, the updated resource will be pulled from the origin server and cached again. If you select Purge all resources, when the user accesses a resource under the corresponding directory, the latest version of the resource will be directly pulled from the origin server and cached again.
After a purge is successfully executed, the corresponding resource on the node will not have a valid cache. When the user initiates an access request again, the node will pull the required resource from the origin server and cache it on the node. If you submit a large number of purge tasks, many caches will be cleared, resulting in a surge in origin-pull requests and high pressure on the origin server.
When a resource is overwritten by a new resource with the same name on the origin server, you can submit a request to purge the URL/directory and clear all caches so users can directly access the latest version of the resource. This will prevent users from accessing the legacy version of the resource cached on the node.
When illegal resources (such as resources related to pornography, drug, or gambling) are found on your origin server, they may still be accessible even after you delete them on the origin server because of node cache. To protect your network environment security, you can delete the cached resources through URL purge.
Log in to the CDN Console, click Purge and Prefetch on the left sidebar, and submit a Purge URL or Purge Directory task. You can purge CDN and ECDN URLs/directories together.
If the URL encode feature is enabled, Chinese characters will be converted to URL encoded format during URL and directory purge.
In the History tab, you can query tasks by specified time period, keyword, and task type. Keyword queries only support querying with a domain name or a complete purged URL/directory:
The console can return up to 10,000 logs at a time, which can be exported to an Excel file. If you have more than 10,000 purge tasks, please query and export them in batches.
- When you are running out of daily purge quota, you can increase it on your own in the Tencent Cloud CDN console.
- The new quota will take effect immediately. The page will be refreshed automatically. You don’t need to click the refresh button frequently.
- The quota can only be increased once a day.
- The quota increase in different regions is independent of each other.
Sub-user permissions configuration:
The acceleration domain name is
purge-test-1251991073.file.myqcloud.com, the origin server is Tencent Cloud Object Storage (COS), and resources on the origin server are as follows:
2.txtrespectively. Nodes to be hit can be determined based on
X-Cache-Lookup: Hit From Disktank3and
Server: NWS_SPMid, resources will be directly returned by the nodes:
1.txtwith a file that has the same name, and the file’s last modified time changes, while
2.txtstays the same:
1.txtresource will be accessed:
1.txthas been changed, the request will be forwarded to the origin server. As
2.txthas not been changed, even after a directory purge task is submitted, it will still be hit and returned: