You can call the PushObjectCache operation to preload content from an origin site to an L2 cache node. As a result, users can directly hit cache upon their first visits to relieve pressure on the origin site.

CDN supports POST requests in which parameters are sent as a form.

Note
  • You can call the RefreshObjectCaches operation to refresh content and call the PushObjectCache operation to preload content.
  • You can preload content from a maximum of 2,000 URLs by using the same account each day.
  • You can upload content from up to 100 URLs per request.
  • Up to 50 requests can be submitted per second.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set this parameter to PushObjectCache.
ObjectPath String Yes The URL of the object from which content is preloaded, for example, example.com/image/1.png. You can specify multiple URLs and separate them with line feeds (\n) or (\r\n).
Area String No The region of the L2 cache node. Valid values:
  • domestic
  • overseas

Response parameters

Parameter Type Description
PushTaskId String The ID of the preload task returned. If multiple tasks are returned, the IDs are separated with commas (,).

Examples

Sample request

https://cdn.aliyuncs.com?&Action=PushObjectCache&ObjectPath=example.com/test.txt&ObjectType=File&<Common request parameters>       

Sample success response

JSON format

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

XML format

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

Error codes

Error code Error message HTTP status code Description
Throttling Request was denied due to request throttling. 503 The error message returned because the request was denied due to throttling.
IllegalOperation Illegal domain operate is not permitted. 403 The error message returned because the specified domain name is invalid.
OperationDenied Your account does not open CDN service yet. 403 The error message returned because CDN has not been activated for your account. For more information about how to activate CDN, seeActivate CDN.
OperationDenied Your CDN service is suspended. 403 The error message returned because CDN has been suspended for your account.
InvalidDomain.NotFound The domain provided does not belong to you. 404 The error message returned because the specified CDN domain does not exist or does not belong to you.
InvalidDomain.Offline The domain provided is offline. 404 The error message returned because the specified CDN domain is disabled.
QuotaExceeded.Refresh You've exceeded the prescribed refresh limits. 400 The error message returned because your daily refresh objects have exceed the upper limit.
PreloadQueueFull Preload queue is full, please try again later! 403 The error message returned because the number of URLs that are being preloaded already reaches the maximum number. Try again later.
InvalidDomain.Configure_failed Failed to configure the provided domain. 500 The error message returned because the system has failed to configure the domain and cannot refresh the content.
MissingParameter The input parameter "ObjectPath" that is mandatory for processing this request is not supplied. 400 The error message returned because the specified ObjectPath parameter is not specified.
InvalidObjectPath.Malformed The specific value of parameter ObjectPath is malformed. 400 The error message returned because the specified ObjectPath is invalid.
InvalidExtensiveDomain.ValueNotSupported Extensive domain not supported. 400 The error message returned because wildcard domains are not supported.
InvalidObjectPath.Size.Malformed The size of ObjectPath is bigger than 100. 400 The error message returned because you can only preload a maximum of 100 URLs at one time.