All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

RefreshCaches

Last updated:2021-03-17 11:08:40

RefreshCaches

Description

You can call this operation to refresh content cached on nodes. You can refresh multiple URLs and directories at a time.

  • Notes:

    • A refresh request quota is specified for each account ID and is shared with the Kingsoft Cloud CDN console. You can query the quota in the Kingsoft Cloud CDN console or by calling the GetRefreshOrPreloadQuota operation.
    • Kingsoft Cloud CDN provides the RefreshCaches and PreloadCaches operations to refresh and prefetch content.
    • You must specify at least one of the Files and Dirs parameters, or specify them both. In other words, you can refresh URLs and directories at the same time.
  • Limits:

    • All URLs must start with http:// or https://.
    • Each URL can be up to 1,000 characters in length.
    • All URLs must belong to the domain names that have been added to Kingsoft Cloud CDN for accelerated content delivery.
    • Chinese characters in URLs must be URL-encoded.
    • You can refresh up to 1,000 URLs or 30 directories at a time.
    • Exact match is supported for URLs and directories. Regex match is not supported.
    • This operation supports only the POST request method.

Request syntax

The API request contains the specified directory /2016-09-01/content/RefreshCaches, common request headers, and operation-specific request parameters. For more information, see the sample request.

Request parameters

Parameter Required Type Description
Files No Url[] The URLs of files to be refreshed.
Dirs No Url[] The URLs of directories to be refreshed.

Url

Parameter Required Type Description
Url Yes String The URL to be refreshed. You can specify only one URL at a time.

Response parameters

Parameter Type Description
RefreshTaskId String The ID of the refresh task.

Examples

Sample request

POST method:

POST /2016-09-01/content/RefreshCaches 1.1
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: RefreshCaches
x-version: 2016-09-01
Content-Type:application/json
Accept:application/json
{
  "Files": [
    {
      "Url": "http://test.dxz.ksyun.8686c.com/abc.txt"
    },
    {
      "Url": "http://test.dxz.ksyun.8686c.com/test"
    }
  ],
  "Dirs": [
    {
      "Url": "http://test.dxz.ksyun.8686c.com/abc"
    },
    {
      "Url": "http://test.dxz.ksyun.8686c.com/def"
    }
  ]
}

Sample response

{
 "RefreshTaskId": "1e16f42c-e9fe-4d71-9dcc-4dd33b523a7c"
}
On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback