Refreshes specified objects on points of presence (POPs). The objects can be included in the content of files or URLs. You can refresh multiple URLs in each request.
Operation description
- DCDN supports POST requests in which parameters are sent as a form.
- You can call the RefreshDcdnObjectCaches operation to refresh content and call the PreloadDcdnObjectCaches operation to prefetch content.
- By default, 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 exceeds 200 Mbit/s, you can submit a ticket to request a quota increase. DCDN evaluates your application based on your workloads.
- You can specify up to 1,000 URLs or 100 directories that you want to refresh in each request.
- You can refresh a maximum of 1,000 URLs per minute for each domain name.
- You can call this operation up to 30 times per second per account.
Precautions
- After a refresh task is submitted and completed, your resources that are stored on DCDN POPs are removed. When a POP receives a request to your resources, the request is redirected to the origin server to retrieve the resources. Then, the resources are returned to the client and cached on the POP. If you frequently run refresh tasks, more requests will be redirected to the origin server for resources, which result in high bandwidth costs and undue pressure on the origin server.
- A refresh task takes effect 5 to 6 minutes after being submitted. This means that if the resource you want to refresh has a TTL of less than 5 minutes, you wait for it to expire instead of manually running a refresh task.
- If you want to use RAM users to refresh or prefetch resources, you need to obtain the required permissions. For more information, see Authorize a RAM user to prefetch and refresh resources.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
dcdn:RefreshDcdnObjectCaches | WRITE |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ObjectPath | string | Yes | The path of the objects that you want to refresh. Separate multiple URLs with line feed characters (\n) or a pair of carriage return and line feed characters (\r\n). | example.com/example.txt |
ObjectType | string | No | The refresh type. Valid values:
Note
| File |
Force | boolean | No | Specifies whether to refresh resources in a directory if the resources are different from the resources in the same directory in the origin server. Default value: false.
| false |
Response parameters
Examples
Sample success responses
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 | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
2023-10-17 | The Error code has changed. The request parameters of the API has changed | see changesets | ||||||||||
| ||||||||||||
2023-07-03 | The Error code has changed | see changesets | ||||||||||
|