Content Refresh
Why do we need to refresh?
When the origin server updates files, UCDN does not actively fetch the latest files. We need to manually refresh the UCDN cache to trigger UCDN node to fetch new files or verify if files need to be updated from the origin server.
Generally, when files are updated on the origin server, you can refresh the content to ensure users get the latest files.
Content refreshing includes: File Refresh and Directory Refresh
Default refresh limit per domain: File Refresh: 700 entries/day Directory Refresh:20 entries/day; if you need to increase the refresh limit, please contact technical support.
The refresh takes effect within about 1 minute. If there are many refresh tasks, it may cause queuing. Please be patient. If the refresh fails or a single refresh task is stuck for more than 10 minutes, please contact technical support.
Directory Refresh
1) It must start with http(s):// and end with / ; It is suggested to use http://. The cache is shared between http and https, so when refreshing http protocol files, https protocol files will also be refreshed.
2) Please note the letter case in the url, incorrect case will render the refresh ineffective. Wildcard or regex inputs are not supported.
3) If there is a hierarchical relationship in the directory, this feature will automatically push the subdirectories without needing to input them.
4) When using Directory Refresh, the files in the directory will be set to expired in cache. After refreshing, when the user accesses resources in the directory, it will compare the Last-Modify and etag header information of the origin server. If it is consistent with the node cache resources, it will return cached resources directly. If not, it will fetch resources from the origin server and re-cache them.
5) Note: If there are many updates to the origin server, there will be a large amount of source fetching after directory refresh, please operate with caution.
File Refresh
1) It must start with http(s):// and be filled with a complete path, like http://static.abc.cn/images/test.jpg. It is suggested to use http://. The cache is shared between http and https, so when refreshing http protocol files, https protocol files will also be refreshed.
2) Please note the letter case in the url, incorrect case will render the refresh ineffective. Wildcard or regex inputs are not supported.
3) A maximum of 30 urls can be submitted at a time, one per line.
4) Delete the corresponding resource cache on all CDN nodes. The next time a user requests, the new file will be fetched from the origin server.
Note:
-
If directories and files are filled in at the same time, the contents written in both directories and files will be submitted simultaneously. The records and status of content refresh can be viewed in the list.
-
Content refresh for large file downloads and on-demand streaming does not support input in Chinese, even after encoding. However, content refresh for webpage acceleration supports input in Chinese, but it will fail if the Chinese is encoded.
-
Directory deletion: Applicable scenarios——Suitable for the scenario where the clients’ origin server files have changed, but the last-modified and etag headers have not, there are many files under the directory and the domain as a whole doesn’t have much traffic. Currently, deletion of file cache under the directory through console operation is not support. If needed, please contact technical support.
-
If you want users to access the latest resources, the sequence should be: firstly, update resources on the origin server, then refresh CDN. Otherwise, users might continue to access old resources.
Relevant API documentation:
Check domain refresh task status: DescribeNewUcdnRefreshCacheTask
Refresh cache: RefreshNewUcdnDomainCache
Operation Steps:
Related Questions:
- Shared cache refresh between domains: If any URL is refreshed, the resources corresponding to both domain A and domain B will be refreshed; Directory refresh is based on the key domain. If domain B shares cache with domain A, and you need to push cache for both domain A and domain B, just push directory for domain A.
- Refresh content of domain configured with timestamped anti-theft chain: Just refresh URL/directory without parameters.
- Refresh content of domain configured with cache rewrite: Need to refresh URL/directory after rewrite.
- Wildcard domains do not support direct refresh, refresh should be done through specific domains.