Refreshes files on Alibaba Cloud CDN edge nodes. After files are refreshed, the original file content immediately becomes invalid. If clients request the original file content, Alibaba Cloud CDN redirects the requests to the origin server of the content. Then, Alibaba Cloud CDN caches the latest content to the edge nodes and returns it to the clients. Alibaba Cloud CDN allows you to refresh content from multiple URLs at a time.
- Alibaba Cloud CDN supports POST requests in which parameters are sent as a form.
- You can call the RefreshObjectCaches operation to refresh content and call the PushObjectCache operation to prefetch content.
- Each Alibaba Cloud account can refresh content from a maximum of 10,000 URLs and 100 directories per day, including subdirectories. If the daily peak bandwidth value of your workloads exceeds 200 Mbit/s, you can submit a ticket to request a quota increase. Alibaba Cloud reviews your application and then increase the quota accordingly.
- You can specify at most 1,000 URLs or 100 directories that you want to refresh in each call.
- You can refresh a maximum of 1,000 URLs per minute for each domain name.
- The maximum number of times that each user can call this operation per second is 50.
- For more information about how to automate refresh or prefetch tasks, see Prefetch and refresh task scripts.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | RefreshObjectCaches |
The operation that you want to perform. Set the value to RefreshObjectCaches. |
ObjectPath | String | Yes | http://example.com/image/1.png\nhttp://aliyundoc.com/image/2.png |
The URLs from which content is refreshed. Format: accelerated domain name/paths or directories of files to be refreshed. Separate multiple URLs with line feed characters (\n) or a pair of carriage return and line feed characters (\r\n). |
ObjectType | String | No | File |
The type of object to be refreshed. Valid values:
Default value: File. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RefreshTaskId | String | 704222904 |
The ID of the refresh task. If multiple tasks are returned, the IDs are separated by commas (,). The task IDs are merged based on the following rules:
|
RequestId | String | D61E4801-EAFF-4A63-AAE1-FBF6CE1CFD1C |
The ID of the request. |
Examples
Sample requests
http(s)://cdn.aliyuncs.com/?Action=RefreshObjectCaches
&ObjectPath=http://example.com/image/1.png\nhttp://aliyundoc.com/image/2.png
&ObjectType=File
&<Common request parameters>
Sample success responses
XML
format
<RefreshObjectCachesResponse>
<RefreshTaskId>704222904</RefreshTaskId>
<RequestId>D61E4801-EAFF-4A63-AAE1-FBF6CE1CFD1C</RequestId>
</RefreshObjectCachesResponse>
JSON
format
{
"RefreshTaskId":"704222904",
"RequestId":"D61E4801-EAFF-4A63-AAE1-FBF6CE1CFD1C"
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | SingleRequest.OverLimit | A maximum of 1000 URLs are supported for each request. | The error message returned because you can specify at most 1,000 URLs in each call. |
400 | InvalidObjectType.Malformed | The specified ObjectType is invalid. | The error message returned because the ObjectType parameter is set to an invalid value. |
For a list of error codes, visit the API Error Center.