查询缓存过期规则
更新时间:2023-09-27
接口
本接口用于查询指定加速域名的缓存策略。此域名必须是本用户的,否则会返回403失败。
Method | Path | 说明 |
---|---|---|
GET | /v2/domain/{domain}/config?cacheTTL | 查询域名的缓存策略 |
domain:需要查询CDN的加速域名
响应码 (Http Status Code)
HTTP Status Code | 说明 |
---|---|
200 | 成功 |
响应体 (Response Body)
参数 | 类型 | 说明 |
---|---|---|
cacheTTL | CacheTTL | 缓存规则列表 |
CacheTTL
参数 | 类型 | 说明 |
---|---|---|
type | String | "suffix"表示文件名后缀,"path"表示目录,"exactPath"表示精确文件路径,"code"表示异常状态码 |
value | String | type所指定类型的配置规则 |
weight | Int | 权重,0-100的整数,权重越高优先级越高,默认为0,优先级在为code类型下是没有作用的,可以忽略 |
ttl | Int | 缓存时间,单位为秒 |
overrideOrigin | bool | 缓存是否遵循源站,overrideOrigin=true表示不遵循源站,按照该条配置规则缓存 |
请求示例
Plain Text
1GET /v2/domain/myself.baidu.com/config?cacheTTL HTTP/1.1
2Host: cdn.baidubce.com
响应示例
Plain Text
1HTTP/1.1 200 OK
2Server: nginx
3Date: Wed, 26 Jun 2019 03:42:11 GMT
4Content-Type: application/json; charset=utf-8
5Transfer-Encoding: chunked
6Connection: keep-alive
7X-Powered-By: PHP/7.1.5
8x-bce-request-id: ab205979-7024-f90f-4995-d9b0fc599ad1
9
10{
11 "cacheTTL": [
12 {
13 "type": "suffix",
14 "value": ".php;.jsp;.asp",
15 "ttl": 0,
16 "weight": 3,
17 "overrideOrigin": true
18 },
19 {
20 "type": "path",
21 "value": "/",
22 "ttl": 2592000,
23 "weight": 1,
24 "overrideOrigin": true
25 }
26 ]
27}