站点缓存方式
查看或设置单个站点使用的缓存分组或自定义规则。
cache-sites缓存鉴权: 用户(部分参数仅管理员)2 个接口站点的缓存方式
GET
/api/v2/cache-sites/{id}鉴权: 用户(部分参数仅管理员)
站点引用缓存分组
PUT
/api/v2/cache-sites/{id}鉴权: 用户(部分参数仅管理员)
请求体 application/json
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| expected_updated_at | string | — | 乐观锁(修改时用):调用方读到的站点 updated_at。与库里当前值不等则回 409 stale_version、不保存;不带则不检查;创建时忽略。 |
| group_id | integer | 必填 | 显式引用的分组;null = 按默认分组。 |
站点缓存方式对象
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| effective_group_id | integer | — | mode=group 时实际生效的分组;null = 没有可用分组(不下发缓存规则)。 |
| expected_updated_at | string | — | 乐观锁(修改时用):调用方读到的站点 updated_at。与库里当前值不等则回 409 stale_version、不保存;不带则不检查;创建时忽略。 |
| group_id | integer | — | 显式引用的分组;null = 按默认分组。 |
| mode | string | — | 缓存方式:group 按缓存分组;custom 为站点自定义规则。 |
| site_id | integer | — | 网站 ID |
| updated_at | string | — | 站点的 updated_at(站点行的版本,改缓存方式也会更新);改缓存方式时作 expected_updated_at 带回。 |