Prefetches content from origin servers to L2 CDN edge nodes.

Note
  • This feature reduces loads on origin servers because users can directly hit cache upon their first visits.
  • Each Alibaba Cloud account can refresh at most 2,000 URLs per day. You cannot prefetch content based on directories.
  • You can call the RefreshObjectCaches operation to refresh content and call the PushObjectCache operation to prefetch content.
  • Alibaba Cloud CDN supports POST requests in which parameters are sent as a form.
  • L2 CDN edge nodes are deployed between L1 CDN edge nodes and origin servers to reduce loads on the origin servers.

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 abc.com/image/1.png

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

The URLs to be refreshed. You can specify multiple URLs and separate them with line feed characters (\n or \r\n).

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 global (excluding mainland China) region is prefetched.

Response parameters

Parameter Type Example Description
PushTaskId String 95248880

The ID of the prefech task.

RequestId String 16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

The ID of the request.

Examples

Sample requests

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

Sample success responses

XML format

<PushObjectCacheResponse>
    <PushTaskId>95250421</PushTaskId>
    <RequestId>5FF9B16E-FBAC-48E5-9052-65B5F0184DB3</RequestId>
</PushObjectCacheResponse>

JSON format

{
  "PushTaskId": "95248880",
  "RequestId": "E5BD4B50-7A02-493A-AE0B-97B9024B4135"
}

Error codes

HttpCode Error code Error message Description
400 QuotaExceeded.Refresh You've exceeded the prescribed refresh limits. The error message returned because the maximum number of URLs that can be refreshed on the current day has been reached. The quota for the current day is exhausted. You can call the DescribeDcdnRefreshQuota operation to query the remaining quota for the current day.
400 InvalidObjectPath.Malformed The specific value of parameter ObjectPath is malformed. The error message returned because the value of the ObjectPath parameter is in an invalid format. Example: abc.com/image/1.png. You can specify multiple URLs and separate them with line feed characters (\n or \r\n).
400 InvalidExtensiveDomain.ValueNotSupported Extensive domain not supported. The error message returned because this operation does not support wildcard domain names.
403 PreloadQueueFull Preload queue is full, please try again later! The error message returned because the prefetch queue is full. Try again later.
400 InvalidObjectPath.Size.Malformed The size of ObjectPath is bigger than 1000. The error message returned because the maximum number of URLs that can be prefetched is 1,000.

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