Prefetches content from the origin server to L2 cache nodes so that users can hit the cache on their first visit, which reduces the load on the origin server.
Operation description
-
Related operations: 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 commit up to 1,000 URL prefetch nodes per day. If the daily peak bandwidth of your account exceeds 200 Mbit/s, you can apply to increase the daily quota through submit a ticket. Alibaba Cloud will evaluate and configure the quota based on your actual business requirements.
-
You can commit up to 100 URL prefetch nodes at a time.
-
Prefetch queue rules: The maximum prefetch queue size for each account is 100,000 URLs. DCDN prefetches URLs in the order they are committed. When the number of unfinished nodes in the prefetch queue reaches 100,000 URLs, Alibaba Cloud DCDN implements a queuing mechanism. This means you can commit the next URL prefetch node only after the first URL in the sorting is prefetched.
-
Invoke frequency per user: 15 invokes per second.
Precautions
After a prefetch node is committed and successfully executed, the DCDN point of presence (POP) immediately requests resources from the origin server. Therefore, committing a large number of prefetch nodes generates many concurrent download nodes, which causes a sudden increase in back-to-origin bandwidth and requests, and increases the load on the origin server.
The actual execution time from commit to completion of a prefetch node depends on the size of the prefetched files and takes about 5 to 30 minutes. The smaller the average file size, the faster the prefetch speed.
To use a Resource Access Management (RAM) user to perform refresh or prefetch operations, you must first obtain authorization for the Resource Access Management (RAM) user. For more information, see Grant authorization to a Resource Access Management (RAM) user to refresh and prefetch resources.
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 be prefetched. The format is accelerated domain name/prefetched file. Note
Separate multiple URLs with line breaks. The maximum length of a single ObjectPath is 1,024 characters. |
http://example.com/examplefile.txt http://example.com/examplefile2.txt |
| Area |
string |
No |
The prefetch region. Valid values:
If you do not specify this parameter, the default prefetch region is the DCDN acceleration region configured for your domain name. Details are as follows:
Valid values:
|
domestic |
| L2Preload |
boolean |
No |
Specifies whether to prefetch content directly to L2 nodes. Valid values:
|
true |
| WithHeader |
string |
No |
The custom prefetch headers. Submit the headers in JSON format. |
{ "Accept-Encoding": [ "gzip" ] } |
| QueryHashkey |
boolean |
No |
This parameter is used when specific rules, such as URL rewrite and parameter filtering, are configured. It specifies whether to enable the hash key query mode when executing prefetch tasks. Valid values:
|
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| PreloadTaskId |
string |
The ID of the prefetch task. Multiple task IDs are separated by commas (,). The returned task IDs are merged based on the following two 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.