PreloadCaches

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

PreloadCaches

Description

You can call this operation to prefetch content to nodes from the origin. When users access the content for the first time, they can directly obtain the content from the cache, reducing the workload of the origin server.

  • 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 prefetch up to 1,000 URLs at a time.
    • You can prefetch only files with exact URLs. Directories cannot be prefetched, and 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/PreloadCaches, common request headers, and operation-specific request parameters. For more information, see the sample request.

Request parameters

Parameter Required Type Description
Urls Yes Url[] The URLs to be prefetched.

Url

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

Response parameters

Parameter Type Description
PreloadTaskId String The ID of the prefetch task.

Examples

Sample request

POST method:

POST /2016-09-01/content/PreloadCaches 1.1
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
Content-Type:application/json
Accept:application/json
X-Action: PreloadCaches
X-Version: 2016-09-01

{
  "Urls": [
    {
      "Url": "http://test1.ksyun.com/1.html"
    },
    {
      "Url": "http://test2.ksyun.com/2.html"
    }
  ]
}

Sample response

{
    "PreloadTaskId": "3e16f42c-e9fe-4d71-9dcc-4dd53b573a7c"
}

Did you find the above information helpful?

Unhelpful
Mostly Unhelpful
A little helpful
Helpful
Very helpful

What might be the problems?

Insufficient
Outdated
Unclear or awkward
Redundant or clumsy
Lack of context for the complex system or functionality

More suggestions

0/200

Please give us your feedback.

Submitted

Thank you for your feedback.

问题反馈