Call the PreloadDcdnObjectCaches operation to prefetch content from an origin server to L2 cache nodes. This allows first-time user requests to hit the cache directly, which reduces the load on the origin server.
Operation description
-
Related operations: The refresh and prefetch operations include RefreshDcdnObjectCaches for refreshing content and PreloadDcdnObjectCaches for prefetching content.
-
Request method: POST. Parameters are passed in a form.
-
Daily URL prefetch quota: By default, you can submit up to 1,000 URL prefetch tasks per day for each account. If the daily peak bandwidth for your account exceeds 200 Mbps, you can request a quota increase in the console or by submitting a ticket. Alibaba Cloud evaluates your business needs and adjusts the quota accordingly.
-
You can submit up to 100 URL prefetch tasks in each request.
-
Prefetch queue rules: The prefetch queue for each account can hold a maximum of 100,000 URLs. DCDN processes prefetch tasks in the order they are submitted. If the number of pending tasks in the queue reaches 100,000, DCDN queues new tasks. A new task can be submitted only after the task at the front of the queue is completed.
-
Call frequency for a single user: 15 calls per second.
Notes
After a prefetch task is submitted and executed, DCDN nodes immediately fetch the required resources from the origin server. Submitting many prefetch tasks at once creates many concurrent download tasks. This can cause a surge in back-to-origin bandwidth and requests, increasing the load on your origin server.
The time required to complete a prefetch task depends on the file size. It usually takes 5 to 30 minutes. The smaller the average file size, the faster the prefetch task is completed.
If a RAM user is used to perform refresh or prefetch operations, you must first grant permissions to the RAM user. For more information, see Grant permissions to a 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 URL of the object to prefetch. The URL must be in the format of accelerated domain name/object to prefetch. Note
Separate multiple URLs with line feeds (\n) or carriage return line feeds (\r\n). The maximum length of a single URL is 1,024 characters. |
example.com/examplefile.txt |
| Area |
string |
No |
The prefetch region. Valid values:
If you do not set this parameter, the default prefetch region is the acceleration region configured for your domain name. The details are as follows:
|
domestic |
| L2Preload |
boolean |
No |
Specifies whether to prefetch content directly to L2 nodes. Valid values:
|
true |
| WithHeader |
string |
No |
Lets you customize prefetch headers. Submit the headers in JSON format. |
{ "Accept-Encoding": [ "gzip" ] } |
| QueryHashkey |
boolean |
No |
Enable this parameter if you have configured rules such as URL rewrite or parameter filtering. This parameter controls whether to enable the hashkey query mode for 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 prefetch 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.