Refreshes file content on nodes. The cached files that are refreshed immediately become invalid. New requests retrieve the latest files from the origin server. Batch URL refresh is supported.
Operation description
Request method: POST requests are supported. Parameters are displayed in a form.
Related operations: The refresh and prefetch operations include the RefreshObjectCaches refresh operation and the PushObjectCache prefetch operation.
Maximum number of calls per user per second: 50.
To automate refresh or prefetch tasks, refer to Refresh and prefetch automation scripts.
Before you begin
After a refresh node is committed and successfully executed, the cached resources on the corresponding points of presence become invalid. When you send an access request for the resources, the points of presence perform origin fetch to retrieve the latest resources and cache the resources on the points of presence. Committing a large number of refresh nodes at a time clears a large amount of cache, which causes a spike in origin fetch bandwidth and requests and increases the load on the origin server.
A refresh node takes about 5 to 6 minutes to take effect. If the cache validity period configured for a file or folder is less than 5 minutes, you do not need to execute a refresh. Wait for the cached file or folder to reach timeout and update automatically.
To use a Resource Access Management (RAM) user to execute refresh or prefetch operations, obtain the required permissions first. Refer to Grant permissions to a RAM user for refresh and prefetch to complete the authorization.
URL refresh quota
By default, each account can commit up to 10,000 URL refresh requests and 100 folder refresh requests per day. Folder refresh includes subdirectories. If the daily peak bandwidth of your Alibaba Cloud account exceeds 200 Mbit/s, you can request a higher daily quota by referring to Quota management. Alibaba Cloud evaluates and configures the quota based on your actual business requirements.
By default, each account can commit up to 20 regex-based refresh requests and 100 parameter-stripped refresh requests per day. If the daily peak bandwidth of your Alibaba Cloud account exceeds 10 Gbit/s, you can request a higher daily quota by filling out the form.
Each request can contain up to 1,000 URL refresh entries, 100 folder refresh entries, or 1 regex-based refresh entry.
A maximum of 10,000 URL refresh entries can be committed per minute for a single domain name.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cdn:RefreshObjectCaches |
none |
*Domain
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ObjectPath |
string |
Yes |
|
http://example.com/image/1.png http://aliyundoc.com/image/2.png |
| ObjectType |
string |
No |
The refresh type. Valid values:
Note
|
File |
| Force |
boolean |
No |
Specifies whether to directly delete the cache on points of presence. Default value: false.
Note
This parameter takes effect only when you use folder refresh, regex-based refresh, or parameter-stripped refresh. |
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RefreshTaskId |
string |
The node ID returned for the refresh request. Multiple node IDs are separated by commas (,). The returned node IDs are merged based on the following rules:
|
704222901 |
| RequestId |
string |
The request ID. |
D61E4801-EAFF-4A63-AAE1-FBF6CE1CFD1C |
Examples
Success response
JSON format
{
"RefreshTaskId": "704222901",
"RequestId": "D61E4801-EAFF-4A63-AAE1-FBF6CE1CFD1C"
}
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. | |
| 400 | InvalidObjectPath.Malformed | The specified ObjectPath is invalid. | |
| 400 | QuotaExceeded.Refresh | Your refresh attempts have exceeded the daily limit. | Refresh quantity exceeds daily quota limit. |
| 400 | InvalidExtensiveDomain.ValueNotSupported | The specified ExtensiveDomain is not supported. | |
| 400 | QuotaPerMinuteExceeded.Refresh | You tried to refresh too frequently, please try again later. | |
| 400 | TooMany.Refresh | The refresh queue is full, please 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.