PushObjectCache
Prefetches content from the origin server to cache nodes. This allows first-time access to directly hit the cache, reducing the load on the origin server.
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.
Daily URL prefetch quota: By default, each account can submit up to 1,000 URL prefetch tasks per day. If the daily peak bandwidth of your account exceeds 200 Mbit/s, you can submit a ticket to request a higher daily quota. Alibaba Cloud evaluates and configures the quota based on your actual business requirements.
You can submit up to 100 URL prefetch tasks at a time.
Prefetch queue rules: The maximum prefetch queue size for each account is 100,000 URLs. CDN prefetches URLs in the order in which they are submitted. When the number of URLs pending prefetch in the queue reaches 100,000, CDN rejects new prefetch tasks.
Maximum number of times that each user can call this operation per second: 50.
To automate refresh or prefetch tasks, refer to Scripts for Refresh and Prefetch.
Before you begin
After a prefetch node is submitted and successfully executed, points of presence immediately perform origin fetch to load the required resources. Submitting a large number of prefetch nodes generates many concurrent download nodes, which causes a surge in origin fetch bandwidth and requests and increases the load on the origin server.
The actual execution time of a prefetch node from commit to completion depends on the size of the prefetched file and typically takes 5 to 30 minutes. The smaller the average file size, the faster the prefetch.
To use a Resource Access Management (RAM) user to perform refresh or prefetch operations, obtain the required authorization first. Refer to Grant permissions to a RAM user for refresh and prefetch to complete the authorization.
The default header carried in a prefetch request is Accept-Encoding:gzip. To carry other headers in prefetch requests or implement multi-copy prefetch, use the WithHeader request parameter to customize prefetch headers.
During prefetch, if the origin server returns a redirection status code such as 307, the prefetch node does not follow the redirect URL to complete the prefetch, which causes the prefetch to fail. If the origin server returns a 301 or 302 status code and 302 redirection is enabled on CDN, normal prefetch is not affected.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cdn:PushObjectCache |
none |
*Domain
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ObjectPath |
string |
Yes |
The URL to prefetch. The format is accelerated domain name/file to prefetch. Note
Separate multiple URLs with line breaks. Each URL can be up to 1,024 characters in length. |
example.com/image/1.png\nexample.org/image/2.png |
| Area |
string |
No |
The prefetch region. Valid values:
If you do not set this parameter, the default prefetch region is the CDN acceleration region configured for your domain name. Note
|
domestic |
| L2Preload |
boolean |
No |
Specifies whether to prefetch content directly to L2 nodes. Valid values:
|
true |
| WithHeader |
string |
No |
The default header carried in a prefetch request is Accept-Encoding:gzip. To carry other headers in prefetch requests or implement multi-copy prefetch, use this parameter to customize prefetch headers. Submit the value in JSON format. Note
To exclude the Accept-Encoding header during prefetch, submit the following:
|
{ "Accept-Encoding": [ "gzip, deflate, br" ] } |
| QueryHashkey |
boolean |
No |
Specifies whether to enable hashkey query mode when executing prefetch tasks. Valid values:
|
true |
| ConsistencyHash |
boolean |
No |
If the acceleration region of the domain name is the Chinese mainland and hash-based origin fetch is enabled, you can use this parameter to enable hash-based prefetch. This implements regional back-to-origin convergence and reduces the back-to-origin bandwidth generated by prefetch.
Important This parameter takes effect only for domain names whose acceleration region is the Chinese mainland. |
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| PushTaskId |
string |
The ID of the prefetch task. Multiple task IDs are separated by commas (,). The returned task IDs are merged based on the following rules:
|
9524xxxx |
| RequestId |
string |
The request ID. |
16A96B9A-F203-4EC5-8E43-CB92E68F4CD8 |
Examples
Success response
JSON format
{
"PushTaskId": "9524xxxx",
"RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8"
}
Error codes
|
HTTP status 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 | QuotaPerMinuteExceeded.Refresh | You have exceeded the prescribed preload limits per minute. | |
| 400 | InvalidObjectPath.ExceedsMaximum | The maximum number of urls is exceeded. | The number of submitted URLs exceeds the maximum limit. |
| 400 | InvalidCustomHeader | Parse preload header failed. | Custom header parsing error. |
| 429 | TooManyRequests | System load fluctuates, please try again later. | System load fluctuates, please try again later. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.