Refreshes specified objects on points of presence (POPs). The objects can be included in the content of files or URLs. You can refresh multiple URLs in each request.

Description

  • Alibaba Cloud Dynamic Route for CDN (DCDN) supports POST requests in which parameters are sent as a form.
  • You can call the RefreshDcdnObjectCaches operation to refresh content and call the PreloadDcdnObjectCaches operation to prefetch content.
  • By default, each Alibaba Cloud account can refresh content from a maximum of 10,000 URLs and 100 directories per day, including subdirectories. If the daily peak bandwidth value of your workloads exceeds 200 Mbit/s, you can submit a ticket to apply for an increased upper limit. Alibaba Cloud will review your application and then increase the quota accordingly.
  • You can specify up to 1,000 URLs or 100 directories that you want to refresh in each request.
  • You can refresh a maximum of 1,000 URLs per minute for each domain name.
  • You can call this operation up to 30 times per second per account.

Usage notes

  • After a refresh task is submitted and completed, your resources that are stored on CDN POPs are removed. When a POP receives a request your resources, the request is redirected to the origin server to retrieve the resources. Then, the resources are returned to the client and cached on the POP. If you frequently run refresh tasks, more requests will be redirected back to the origin server for resources, which result in high bandwidth costs and undue pressure on the origin server.
  • A refresh task takes effect five to six minutes after being submitted. This means that if the resource you want to refresh has a TTL of less than five minutes, you wait for it to expire instead of manually running a refresh task.
  • If you want to use Resource Access Management (RAM) users to refresh or prefetch resources, you must acquire the required permissions. For more information, see Authorize a RAM user to prefetch and refresh resources.

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 RefreshDcdnObjectCaches

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

ObjectPath String Yes example.com/example.txt

The path of the objects that you want to refresh. Separate multiple URLs with line feed characters (\n) or a pair of carriage return and line feed characters (\r\n).

ObjectType String No File

The refresh type. Default value: File. Valid values:

  • File: URL
  • Directory: directory

Response parameters

Parameter Type Example Description
RefreshTaskId String 95248880

The ID of the refresh task. Multiple IDs are separated by commas (,).

RequestId String E5BD4B50-7A02-493A-AE0B-97B9024B4135

The ID of the request.

Examples

Sample request

http(s)://dcdn.aliyuncs.com/?Action=RefreshDcdnObjectCaches
&ObjectPath=example.com/example.txt
&ObjectType=File
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<RefreshDcdnObjectCachesResponse>
    <PushTaskId>95248880</PushTaskId>
    <RequestId>E5BD4B50-7A02-493A-AE0B-97B9024B4135</RequestId>
</RefreshDcdnObjectCachesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

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 the request contains more than the maximum number of URLs. You can specify up to 1,000 URLs in each request.
400 InvalidObjectType.Malformed The specified ObjectType is invalid. The error message returned because the value specified for the ObjectType parameter is invalid. Specify a valid value.
400 InvalidObjectPath.Malformed The specified ObjectPath is invalid. The error message returned because the specified value of the ObjectPath parameter is invalid. Specify a valid value.
400 QuotaExceeded.Refresh Your refresh attempts have exceeded the daily limit. The error message returned because the refresh quota for the current day has been exhausted. You can no longer perform the refresh operation on the current day. You can call the DescribeDcdnRefreshQuota operation to query the remaining quota of refresh requests for the current day.
400 InvalidExtensiveDomain.ValueNotSupported The specified ExtensiveDomain is not supported. The error message returned because wildcard domain names are not supported.
400 QuotaPerMinuteExceeded.Refresh You tried to refresh too frequently; please try again later. The error message returned because refresh requests are submitted too frequently. Try again later.
400 TooMany.Refresh The refresh queue is full; please try again later. The error message returned because the maximum number of refresh requests for a domain name has been reached. Try again later.

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