缓存配置接口¶
POST 更新缓存规则¶
POST /prod-api/cdn/layer7/advance/modifyCacheRules
Body 请求参数
新增规则(请求体中不写 locationId):
编辑规则(需带上 locationId):
{
"domainId": 205,
"locationId": 888,
"type": "1",
"name": "*",
"cacheTime": 0,
"cacheTimeUnit": "s"
}
填写说明¶
| 场景 | locationId |
|---|---|
| 新增规则 | 请求体中不写该参数 |
| 编辑规则 | 必填,取 查询缓存规则 返回的 data.row[].locationId |
请求参数¶
| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
|---|---|---|---|---|---|
| Authorization | header | string | 是 | - | |
| body | body | L7CacheRuleVo | 否 | L7CacheRuleVo | - |
返回示例
200 Response
201 Response
返回结果¶
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | - | Inline |
| 201 | Created | - | Inline |
| 401 | Unauthorized | - | Inline |
| 403 | Forbidden | - | Inline |
| 404 | Not Found | - | Inline |
返回数据结构¶
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » msg | string | true | - | - | |
| » code | integer | true | - | - |
数据模型¶
L7CacheRuleVo¶
{
"cacheTime": 0,
"cacheTimeUnit": "string",
"domainId": 0,
"ignoreHeaders": [
"string"
],
"name": "string",
"type": 0
}
编辑时在上述基础上增加 locationId。
L7CacheRuleVo
属性¶
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| cacheTime | integer(int32) | true | - | 缓存时间 | - |
| cacheTimeUnit | string | true | - | 缓存单位 | - |
| domainId | integer(int64) | true | - | 域名id | - |
| ignoreHeaders | [string] | false | - | 忽略请求头 | 可选,字符串数组。取值有: Expires Cache-Control Set-Cookie X-Accel-Expires |
| locationId | integer(int64) | 否 | - | 规则 ID | 缓存规则的唯一标识。新增时请求体中不写该参数;编辑时必填,与查询接口 data.row[].locationId 一致 |
| name | string | true | - | 内容 | - |
| type | integer(int32) | true | - | 类型 | 取值有: 1:表示全部; 2:表示文件类型; 3:表示文件夹; 4:表示全路径; 5:表示首页。 |