Prefetches content from origin servers to points of presence (POPs). This reduces loads on origin servers because users can directly hit cache upon their first visits.
Operation Description
- 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 submit at most 1,000 URLs per day. If your daily peak bandwidth exceeds 200 Mbit/s, you can submit a ticket to increase the upper limit. Alibaba Cloud will review your application and then increase the quota accordingly.
- Each Alibaba Cloud account can submit up to 100 URLs at a time.
- For each Alibaba Cloud account, the prefetch queue can contain up to 50,000 URLs. Content is prefetched based on the time when the URLs are submitted. The URL that is submitted the earliest has the highest priority. If the number of URLs in the queue reaches 50,000, you cannot submit more URLs until the number drops below 50,000.
- You can call this operation up to 50 times per second per account.
- For more information about how to automate refresh or prefetch tasks, see Prefetch and refresh task scripts.
Precautions
- After a refresh task is submitted and completed, the POPs immediately start to retrieve resources from the origin server. Therefore, a large number of refresh tasks cause a large number of concurrent download tasks. This increases the number of requests that are redirected to the origin server. The back-to-origin routing process consumes more bandwidth resources and the origin server may be overwhelmed.
- The time required for a prefetch task to complete is proportional to the size of the prefetched file. In actual practice, most prefetch tasks take 5 to 30 minutes to complete. A task with a smaller average file size takes less time.
- To allow Resource Access Management (RAM) users to perform this operation, you must first grant them the required permissions. For more information, see Authorize a RAM user to prefetch and refresh resources.
Authorization information
The following table is the authorization information corresponding to the API, which can be found in the RAM permission policy statement.Action
Used in the element to grant the RAM user or RAM role permission to call this API. The specific instructions are as follows:
- 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 keyword: refers to the condition keyword defined by the cloud product itself.
- 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.
Operate | access level | Resource type | conditional keyword | Association operation |
---|---|---|---|---|
cdn:PushObjectCache | WRITE |
|
| without |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ObjectPath | string | Yes | The URLs based on which content is prefetched. Format: accelerated domain name/files to be prefetched. NoteSeparate URLs with line feeds (\n or \r\n). Each object path can be up to 1,024 characters in length. | example.com/image/1.png\nexample.org/image/2.png |
Area | string | No | The accelerated region where content is to be prefetched. Valid values:
If you do not set this parameter, content in the accelerated region of the domain name is prefetched. Content is prefetched based on the following rules:
| domestic |
L2Preload | boolean | No | Specifies whether to prefetch content to POPs. Valid values:
| true |
Response parameters
Example
Normal return example
JSON
Format
{
"PushTaskId": "9524xxxx",
"RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8"
}
Error codes
Http code | Error code | Error message | Description |
---|---|---|---|
400 | SingleRequest.OverLimit | A maximum of 1000 URLs are supported for each request. | - |
400 | QuotaExceeded.Preload | Your preload attempts have exceeded the daily limit. | The maximum number of URL prefetches on the current day is exceeded. |
400 | InvalidObjectPath.Malformed | The specified ObjectPath is invalid. | - |
400 | InvalidExtensiveDomain.ValueNotSupported | The specified ExtensiveDomain is not supported. | - |
400 | PreloadQueueFull | The warming queue is full,please try again later. | - |
400 | TooMany.Refresh | Preload queue is full, please try again later. | - |
400 | PreloadQueueFull | Preload queue is full, please try again later. | - |
400 | QuotaPerMinuteExceeded.Refresh | You have exceeded the prescribed preload limits per minute. | - |
400 | InvalidObjectPath.ExceedsMaximum | The maximum number of urls is exceeded. | - |
For a list of error codes, visit the API error center.