Prefetches content from the origin server to L2 Cache nodes so that users can directly hit the cache on their first visit, which reduces the load on the origin server.
Operation description
-
Related operations: The refresh and prefetch operations include the RefreshDcdnObjectCaches refresh operation and the PreloadDcdnObjectCaches prefetch operation.
-
Request method: POST requests are supported. Parameters are displayed in a form.
-
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 request a higher daily quota by Quota Management. 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 prefetch queue for each account can contain up to 100,000 URLs. DCDN processes prefetch tasks in the order in which URLs are submitted. When the number of pending tasks in the prefetch queue reaches 100,000, DCDN uses a queuing mechanism. This means that the next URL prefetch task can be submitted only after the earliest URL prefetch task in the queue is completed.
-
Maximum invocation frequency per user: 15 times per second.
Before you begin
After a prefetch task is submitted and successfully executed, points of presence immediately fetch the required resources from the origin server through back-to-origin requests. Submitting a large number of prefetch tasks at a time generates many concurrent download tasks, which causes a surge in back-to-origin bandwidth and requests and increases the load on the origin server.
The time required to complete a prefetch task after submission depends on the size of the prefetched file. It takes approximately 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 and prefetch operations, obtain the required authorization first. For more information, see Grant permissions to a RAM user for refresh and prefetch.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dcdn:PreloadDcdnObjectCaches |
none |
*domain
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ObjectPath |
string |
Yes |
The URLs 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/examplefile.txt |
| Area |
string |
No |
The prefetch region. Valid values:
If you do not specify this parameter, the prefetch region defaults to the DCDN acceleration region configured for your domain name:
|
domestic |
| L2Preload |
boolean |
No |
Specifies whether to prefetch content directly to L2 nodes. Valid values:
|
true |
| WithHeader |
string |
No |
The custom prefetch headers. Specify the value in JSON format. |
{ "Accept-Encoding": [ "gzip" ] } |
| QueryHashkey |
boolean |
No |
This parameter is used when certain rules (such as URL rewrite or parameter filtering) are configured. It specifies whether to enable hashkey query mode when executing prefetch tasks. Valid values:
|
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| PreloadTaskId |
string |
The IDs of the prefetch tasks. Multiple task IDs are separated by commas (,). The returned task IDs are merged based on the following rules:
|
95248880 |
| RequestId |
string |
The request ID. |
E5BD4B50-7A02-493A-AE0B-97B9024B4135 |
Examples
Success response
JSON format
{
"PreloadTaskId": "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 | QuotaExceeded.Preload | Your refresh attempts have exceeded the daily limit. | The maximum number of refresh and prefetch requests on the current day has been reached. |
| 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 | InvalidExtensiveDomain.ValueNotSupported | The specified ExtensiveDomain is not supported. | Wildcard domain names are not supported. |
| 400 | PreloadQueueFull | The warming queue is full; please try again later. | The maximum number of URLs of the objects that are being prefetched has been reached. Try again later. |
| 400 | InvalidObjectPath.ExceedsMaximum | The maximum number of urls is exceeded. | The number of submitted URLs exceeds the maximum limit. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.