Prefetches content from origin servers to L2 edge nodes. This reduces loads on origin servers because users can directly hit cache upon their first visits.

Note
  • 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.
  • By default, each Alibaba Cloud account can submit up to 1,000 URLs per day. If the daily peak bandwidth value of your workloads exceeds 200 Mbit/s, you can submit a ticket to request a quota increase. Alibaba Cloud reviews 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.
  • The time that a prefetch task takes is based on the average size of the files to be prefetched. The smaller the average file size, the less time the prefetch task takes.
  • The maximum number of times that each user can call this operation per second is 50.
  • For more information about how to automate refresh or prefetch tasks, see Prefetch and refresh task scripts.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes PushObjectCache

The operation that you want to perform. Set the value to PushObjectCache.

ObjectPath String Yes example.com/image/1.png\example.org/image/2.png

The URLs from which content is prefetched. Format: accelerated domain name/files to be prefetched.

Note Separate multiple URLs with line feed characters (\n) or a pair of carriage return and line feed characters (\r\n). Each object path can be up to 1,024 characters in length.
Area String No domestic

The accelerated region where content is to be prefetched. Valid values:

  • domestic: Mainland China Only
  • overseas: Global (Excluding Mainland China)

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:

  • If the accelerated region is set to Mainland China Only, content in regions in the Chinese mainland is prefetched.
  • If the accelerated region is set to Global, content in all regions is prefetched.
  • If the accelerated region is set to Global (Excluding Mainland China), content in regions outside the Chinese mainland is prefetched.
L2Preload Boolean No true

Specifies whether to prefetch content to L2 edge nodes. Valid values:

  • true: prefetch content to L2 edge nodes.
  • false: prefetch content to regular edge nodes. Regular edge nodes can be L2 edge nodes or L3 edge nodes. Default value: false.

Response parameters

Parameter Type Example Description
PushTaskId String 9524xxxx

The ID of the prefetch task. If multiple tasks are returned, the IDs are separated by commas (,). The task IDs are merged based on the following rules:

  • If the tasks are set for the same accelerated domain name, submitted within the same second, and prefetch content from URLs instead of directories, the tasks IDs are merged into the same task ID (RushTaskId).
  • If the number of tasks that are set for the same accelerated domain name, submitted within the same second, and prefetch content from URLs instead of directories exceeds 500, every 500 task IDs are merged into the same task ID (RushTaskId).
RequestId String 16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

The ID of the request.

Examples

Sample requests

http(s)://cdn.aliyuncs.com/?Action=PushObjectCache
&ObjectPath=example.com/image/1.png\example.org/image/2.png
&<Common request parameters>

Sample success responses

XML format

<PushObjectCacheResponse>
    <PushTaskId>9524xxxx</PushTaskId>
    <RequestId>16A96B9A-F203-4EC5-8E43-CB92E68F4CD8</RequestId>
</PushObjectCacheResponse>

JSON format

{
  "PushTaskId": "9524xxxx",
  "RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8"
}

Error codes

HttpCode Error code Error message Description
400 SingleRequest.OverLimit A maximum of 1000 URLs are supported for each request. The error message returned because you can specify at most 1,000 URLs in each call.
400 QuotaExceeded.Preload Your preload attempts have exceeded the daily limit. The error message returned because the prefetch quota for the current day is exhausted.

For a list of error codes, visit the API Error Center.