You can call the `RefreshDcdnObjectCaches` operation to refresh file content on DCDN nodes. You can refresh content for specified URLs in batches.
Operation description
Request method: POST. Parameters are passed in a form.
Related operations: The refresh and prefetch feature includes the RefreshDcdnObjectCaches operation to refresh content and the PreloadDcdnObjectCaches operation to prefetch content.
Daily refresh quota: By default, each Alibaba Cloud account can submit up to 10,000 URL refreshes and 100 directory refreshes per day. A directory refresh includes all its subdirectories. If the daily peak bandwidth for your Alibaba Cloud account exceeds 200 Mbps, you can request a quota increase through or by submitting a ticket. Alibaba Cloud reviews your request and adjusts the quota based on your business needs.
Each request can contain up to 1,000 URLs or 100 directories to refresh.
For a single domain name, you can submit refresh requests for up to 10,000 URLs per minute.
The call frequency for a single user is limited to 30 calls per second.
Notes
When you submit a refresh task, the corresponding cached resources on DCDN nodes are marked as invalid. When a user requests the content again, the DCDN node retrieves the latest version from your origin server and caches it. Submitting many refresh tasks at once clears a large amount of cached content. This can cause a surge in back-to-origin bandwidth usage and requests, which increases the load on your origin server.
A refresh task takes about 5 to 6 minutes to take effect. If the configured time-to-live (TTL) for a file or directory is less than 5 minutes, you do not need to refresh it. Instead, wait for the cache to expire.
If you use a RAM user to perform refresh or prefetch operations, you must first grant the required permissions to the RAM user. For more information, see Grant permissions to a RAM user for refresh and prefetch operations.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dcdn:RefreshDcdnObjectCaches |
none |
*domain
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ObjectPath |
string |
Yes |
|
example.com/example.txt |
| ObjectType |
string |
No |
The type of refresh. Valid values:
Note
|
File |
| Force |
boolean |
No |
Specifies whether to refresh resources within the specified scope even if the content at the origin server is the same as the cached content. The default value is false.
Note
This parameter is valid for all refresh types except file refresh. |
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RefreshTaskId |
string |
The ID of the refresh task. Multiple IDs are separated by commas (,). |
95248880 |
| RequestId |
string |
The ID of the request. |
E5BD4B50-7A02-493A-AE0B-97B9024B4135 |
Examples
Success response
JSON format
{
"RefreshTaskId": "95248880",
"RequestId": "E5BD4B50-7A02-493A-AE0B-97B9024B4135"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | SingleRequest.OverLimit | A maximum of 1000 URLs are supported for each request. | |
| 400 | InvalidObjectType.Malformed | The specified ObjectType is invalid. | The ObjectType parameter is set to an invalid value. Specify a valid value and try again. |
| 400 | InvalidObjectPath.Malformed | The specified ObjectPath is invalid. | The ObjectPath parameter is set to an invalid value. Specify a valid value and try again. |
| 400 | QuotaExceeded.Refresh | Your refresh attempts have exceeded the daily limit. | The number of refresh tasks on the current day has reached the upper limit. You can call the refresh API operation to query the remaining number of refresh tasks that you want to run on the current day. |
| 400 | InvalidExtensiveDomain.ValueNotSupported | The specified ExtensiveDomain is not supported. | Wildcard domain names are not supported. |
| 400 | QuotaPerMinuteExceeded.Refresh | You tried to refresh too frequently; please try again later. | Refresh requests are submitted too frequently. Try again later. |
| 400 | TooMany.Refresh | The refresh queue is full; please try again later. | The maximum number of refresh requests for a domain name has been reached. Try again later. |
| 429 | TooManyRequests | Too many requests, please try again later |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.