RefreshObjectCaches
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: 50 calls per second.
To automate refresh or prefetch tasks, refer to Scripts for refresh and prefetch automation.
Before you begin
After a refresh node is committed and successfully executed, the corresponding cached resources on CDN points of presence become invalid. When you send a new access request, the point of presence performs an origin fetch to retrieve the required resources and caches them again. Committing a large number of refresh nodes clears a large amount of cache, which causes spikes 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 after it is committed. If the cache expiration time configured for a file or folder is less than 5 minutes, you do not need to perform a refresh operation. Wait for the file or folder cache to time out and update automatically.
To use a Resource Access Management (RAM) user to perform refresh or prefetch operations, obtain the required authorization first. Refer to Grant refresh and prefetch permissions to a RAM user 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 submit a ticket. 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-filtering 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 submitting a ticket.
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 CDN points of presence. Default value: false.
Note
This parameter takes effect only when you use folder refresh, regex-based refresh, or parameter-filtering refresh. |
false |
| ReplicaTag |
string |
No |
This parameter is not active. |
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.