RefreshDcdnObjectCaches

更新时间:
复制 MD 格式

Refreshes file content on nodes and refreshes the content of specified URLs to cache nodes. Supports batch URL refresh.

Operation description

  • Request method: POST requests are supported. Parameters are displayed in a form.

  • Related operations: The refresh and prefetch operations include the RefreshDcdnObjectCaches refresh operation and the PreloadDcdnObjectCaches prefetch operation.

  • URL refresh quota (daily): By default, each account can submit up to 10,000 URL refresh requests and 100 directory refresh requests per day. Directory refresh includes subdirectories. If the daily peak bandwidth of your Alibaba Cloud account exceeds 200 Mbit/s, you can request a higher daily quota by Quota Management. Alibaba Cloud will evaluate and configure the quota based on your actual business requirements.

  • Each request supports up to 1,000 URL refresh requests or 100 directory refresh requests.

  • A maximum of 10,000 URL refresh requests can be submitted per minute for a single domain name.

  • Maximum invocation frequency per user: 30 times per second.

Considerations

  • After a refresh node is submitted and successfully executed, the cached resources on DCDN points of presence (POPs) are invalidated. When you send an access request again, the point of presence (POP) retrieves the required resources from the origin server via back-to-origin and caches them on the POP again. Submitting a large number of refresh nodes clears a large amount of cache, which causes spikes in back-to-origin bandwidth and requests and increases the load on the origin server.

  • A refresh node takes approximately 5 to 6 minutes to take effect after it is submitted. If the time-to-live (TTL) configured for a file or directory is less than 5 minutes, you do not need to perform a refresh operation. Wait for the file or directory cache to expire and update automatically.

  • To use a Resource Access Management (RAM) user to perform refresh or prefetch operations, obtain authorization first. For more information, see Grant RAM users the refresh and prefetch permissions.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dcdn:RefreshDcdnObjectCaches

none

*domain

acs:dcdn:*:{#accountId}:domain/{#domainName}

None None

Request parameters

Parameter

Type

Required

Description

Example

ObjectPath

string

Yes

  • Separate multiple URLs or directories with line breaks when submitting them in a single request.

  • The total number of domain names across all URLs in a single request must not exceed 10.

example.com/example.txt

ObjectType

string

No

The refresh type. Valid values:

  • File (default): URL.

  • Directory: directory refresh.

  • Regex: regular expression-based refresh.

  • IgnoreParams: purge by URL with parameters ignored. This refers to removing the ? and all characters after ? from the request URL. When you submit a URL with parameters removed through the API, the submitted URL is matched against cached resource URLs after their parameters are also removed. If a cached resource URL matches the submitted URL after parameter removal, the point of presence executes a refresh on the cached resource.

Note
  • For the feature description of URL refresh and directory refresh, see Refresh and prefetch resources.

  • File refresh directly deletes the resource on the point of presence (POP). When a new request is received, the new resource is retrieved from the origin server via back-to-origin. Other refresh types refresh only changed resources by default. To force a refresh, set the Force parameter to true. For more information, see the description of the Force parameter.

File

Force

boolean

No

Specifies whether to refresh all resources within the corresponding scope when the back-to-origin content is consistent with the origin server resources. Default value: false.

  • true: Refreshes all resources within the corresponding scope. When "Refresh All Resources" is selected, if the requested content matches a resource within the corresponding scope, the DCDN point of presence (POP) retrieves the new resource from the origin server via back-to-origin, returns it to the user, and caches the resource again.

  • false: Refreshes only changed resources within the corresponding scope. When "Refresh Changed Resources" is selected, if the requested content matches a resource within the corresponding scope, the DCDN point of presence (POP) retrieves the Last-Modified information of the resource from the origin server via back-to-origin. If the information is consistent with the currently cached resource, the cached resource is returned directly. If the information is inconsistent, the new resource is retrieved from the origin server via back-to-origin, returned to the user, and cached again.

Note

This parameter takes effect for all refresh types except file refresh.

false

Response elements

Element

Type

Description

Example

object

RefreshTaskId

string

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

95248880

RequestId

string

The request ID.

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

Examples

Success response

JSON format

{
  "RefreshTaskId": "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 InvalidObjectType.Malformed The specified ObjectType is invalid. The ObjectType parameter is set to an invalid value. Specify a valid value and try again.
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 QuotaExceeded.Refresh Your refresh attempts have exceeded the daily limit. The number of refresh tasks on the current day has reached the upper limit. You can call the refresh API operation to query the remaining number of refresh tasks that you want to run on the current day.
400 InvalidExtensiveDomain.ValueNotSupported The specified ExtensiveDomain is not supported. Wildcard domain names are not supported.
400 QuotaPerMinuteExceeded.Refresh You tried to refresh too frequently; please try again later. Refresh requests are submitted too frequently. Try again later.
400 TooMany.Refresh The refresh queue is full; please try again later. The maximum number of refresh requests for a domain name has been reached. Try again later.
429 TooManyRequests Too many requests, please try again later

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.