Prefetch

Update time: 2026-08-27 14:36:26

Applicable Products

Content MGMT

API Description

Proactively pre - fetch the content from the origin server to the CDN nodes. When users visit for the first time, they can directly hit the cache. This not only improves the first - visit speed but also effectively alleviates the pressure on the origin server.

Call frequency

Single user trigger frequency: 10/5min

Request parameter(s)

Body Params

NameDescription
*urlsList
To submit URLs for prefetch (pre-loading) onto CDN edge nodes, the following requirements must be met: The URL must begin with http:// or https://. Example: http://www.a.com/image/test.png. Each individual URL has a maximum length of 2,000 characters. The domain specified in the URL must be an active domain currently under our CDN acceleration service and authorized for prefetch. If the URL contains non-ASCII characters (e.g., Chinese characters), the submitted URL must be percent-encoded (URL-escaped) using UTF-8 encoding. Daily limits (per account, adjustable via technical support): - Maximum 20,000 URLs. - Maximum 200 GB of total file size. The total number of URLs submitted per single API call must not exceed 400.
*viewsList
IPB view identifiers (line/view). Must be an array; an empty array [] is allowed. Valid values depend on platform configuration.
*headersString
fetchOptionString
Prefetch option/strategy identifier (optional). If omitted, default strategy applies. Valid options depend on platform conventions.
isRangeInteger
Only prefetch a range segment of the file header. The user get the file from the beginning, and they will select quickly their interested. If the file header is cached, the first pack time of the user's http request will be short.This feature allows users to filter content faster. For example, if a file has 200MB, only the size of the file 0~range is prefetched, instead of prefetching the entire file. Each account can be configured with a size of the range. If you need to modify the size, please contact us. If this element is assigned a value of 1, the default prefetch is 0~512KB.
aliasDomainString
Alias domain (optional). When the account feature is enabled, the domain must be authorized for prefetch and belong to the current account.
parentDirString
Parent directory (optional). Used together with aliasDomain to specify directory-level attribution or management path for prefetch.
fetchAreaInteger
Default value: 0. Allowed values: 0, 1, 2. Specifies the prefetch region. The default is 0, which prefetches all regions; 1 prefetches the Mainland China region; 2 prefetches regions outside Mainland China.

Response parameter(s)

Body Params

NameDescription
CodeInteger
The status code of the task creation result: 1) 1 means success, 2) 0 means failure.
MessageString
Content system response message after submitting the task.
itemIdString
After calling the API once and submitting the task successfully, the content system will return an itemId. This ID is the unique identifier for each submission. You can use itemId to batch query the status (success/failure) of the task.

Error code

Error code(code)Description(message)HTTP statusSemantic
1success200success
0parse json/xml error200parse json/xml error
0fetchArea is error, must be 0 or 1 or 2200fetchArea is error, must be 0 or 1 or 2
0urls must be array200urls must be array
0username is invalid200username is invalid
0storage today has reached the limit200storage today has reached the limit
0urls can not be empty200urls can not be empty
0the remaining number of urls today can submit is []200the remaining number of urls today can submit is []
0the number of url out of limit200the number of url out of limit
0urls submitted today has reached the limit []200urls submitted today has reached the limit []
0Part of the submitted URLs do not allow prefetching or incorrect URL format (for example, do not start with http: //, https: //) or the domain name has no association with the user (the correct URL prefetching task submitted this time will not be executed )200Part of the submitted URLs do not allow prefetching or incorrect URL format (for example, do not start with http: //, https: //) or the domain name has no association with the user (the correct URL prefetching task submitted this time will not be executed )
0The domain names in all submitted URLs do not allow prefetching or URL format errors (for example, do not start with http: //, https: //) or the domain name has no association with the user200The domain names in all submitted URLs do not allow prefetching or URL format errors (for example, do not start with http: //, https: //) or the domain name has no association with the user
0system error200system error

Example

JSON
XML
JSON
Request example
Copy Copy success
#!/bin/bash
username="username"
apiKey='apiKey'
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://api.atomile.com/ccm/fetch/ItemIdReceiver" \
-X "POST" \
-u "$username:$password" \
-H "Date:$date" \
-H "Content-Type: application/json" \
-H "X-Time-Zone: Asia/Shanghai" \
-d '{
  "urls": [
    "https://www.abc.com/test/test1.txt",
    "https://www.abc.com/test/test2.txt"
  ],
  "views": [
    "viewA",
    "viewB"
  ],
  "headers": "{\"User-Agent\":\"MyFetcher/1.0\",\"Accept\":\"*/*\"}",
  "fetchOption": "default",
  "isRange": 0,
  "aliasDomain": "download.abc.com",
  "parentDir": "/test/"
}'
Response example
Copy Copy success
HTTP/1.1 200 OK
Date: Fri, 26 Oct 2012 06:33:26 GMT
Content-Type: application/json;charset=UTF-8
x-cnc-request-id:{id string auto generated by cloud server}
{
    "Code": 1,
    "Message": "success",
    "itemId": "a2cfcc6fe79c4a8abcab806578f9bada"
}