CDN
Prewarming Query
Endpoint
Request URL: cache/prefetch (GET)
API Host:
cdn.api.edgenext.comAPI Version:
v2
Description
Queries the status of prefetched URLs. Rate limits are specified in the response headers.
Note: Prefetch task records are retained for one month only. Please query and save prefetch status for relevant URLs within this period.
Request Parameters
The following list only includes API-specific request parameters. Common request parameters must also be included for production calls. Common parameters: Tokens can be obtained from the on-call team.
GET Parameters
Parameters are appended to the URL query string, e.g. ?key1=value1&key2=value2.
| Parameter | Data Type | Required | Description |
|---|---|---|---|
| start_time | string | Yes | Start time, e.g. 2018-02-11. The [start_time, end_time, url] combination is one query method, mutually exclusive with the task_id query method |
| end_time | string | Yes | End time, e.g. 2018-02-11 |
| url | string | No | URL whose prefetch status is to be queried. Optional |
| page_number | string | Yes | Page number. Default: 1 |
| page_size | string | Yes | Number of entries per page. Default: 50 |
| task_id | int | Yes | Query method 2: query by task ID. Returns prefetch status for all URLs submitted in a single task |
Examples
# Query by task ID
curl 'https://cdn.api.edgenext.com/v2/cache/prefetch?token=xx&task_id=30042314'
# Query by time range
curl -X GET "https://cdn.api.edgenext.com/v2/cache/prefetch?token=xxx&start_time=2018-02-23&end_time=2018-02-23&page_number=1"
# Query status for a specific URL
curl -X GET "https://cdn.api.edgenext.com/v2/cache/prefetch?token=xxx&start_time=2018-02-24&end_time=2018-02-24&page_number=1&url=http://abc.qingcdn.com/domain/fun/info"
Response Example
JSON format:
{
"code": 0, // 0 = request succeeded
"message":"", // Present when code is non-zero; contains error description
"data": {
"total": 1,
"page_number": 1,
"list": [
{
"id": 3251371549,
"url": "http://portal.qingcdn.com/theme/bsc1.7/images/logo.png",
"status": "completed" // completed, waiting, processing, failed
}
]
}
}
Sample Parameters
{
"start_time": "2018-02-09",
"end_time": "2018-02-09",
"url": "http://portal.qingcdn.com/theme/bsc1.7/images/logo.png"
}
Response Headers
HTTP/1.0 200 OK
Api-Id: 70945467
Content-Type: application/json; charset=utf-8
X-Ratelimit-Grad: minute // Rate limit granularity (minute/hour/day)
X-Ratelimit-Limit: 150 // Requests per minute limit
X-Ratelimit-Remaining: 99 // Remaining requests this minute
X-Retry-After: 31 // Seconds until the current rate limit window resets
HTTP Status Codes
| Status Code | Description |
|---|---|
| 404 | The requested URL is invalid |
| 401 | Authentication error — invalid token or API access not enabled |
| 400 | Invalid request parameters |
| 200 | Request succeeded, data returned |
| 5xx | Please contact the on-call team |
Need help? Contact our support team at support@edgenext.com.
Back to documentation home