URL刷新
更新时间:2020-07-15
接口
本接口用于清除已经缓存的文件,支持批量提交,一次最多提交100个URL,用户24小时之内最多提交20000个URL刷新请求。
Method | Path | 说明 |
---|---|---|
POST | /v2/abroad/cache/purge | 缓存刷新 |
参数 | 可选 | 类型 | 说明 |
---|---|---|---|
tasks | 必选 | list |
任务列表 |
PurgeTask字段说明
参数 | 可选 | 类型 | 说明 |
---|---|---|---|
url | 必选 | String | 要清除的URL |
type | 可选 | String | type默认为file, 表示精确URL刷新,type为directory表示目录刷新 |
备注: 目录刷新的时候,URL可以是/结尾,也可以不是,但都是目录,比如 /a/ 和 /a刷新的目录都是/a/。
响应码(Http Status Code)
Http Status Code | 说明 |
---|---|
201 | 刷新任务接受成功 |
400 | 资源不属于当前用户,urls数量超过1次的限制,(1次最多100条) |
403 | Quota不够 |
响应体(Response Body)
参数 | 类型 | 说明 |
---|---|---|
id | string | 任务id |
POST /v2/abroad/cache/purge HTTP/1.1
Host: cdn.baidubce.com
Content-Type: application/json
Authorization: xxxxxx
Connection: keep-alive
Content-Length: 121
{
"tasks": [
{
"url": "http://www.example.com/test.jpg",
"type": "file"
},
{
"url": "http://www.example.com/a/",
"type": "directory"
}
]
}
HTTP/1.1 201 Created
Server: nginx/1.1.10
Date: Tue, 07 Jul 2020 09:44:02 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
x-bce-request-id: b652b31c-6db8-b248-feee-93de3d37be7
{"id":"eJwFwckNACAMA7CJKpVewI9ZQsP+I2BH6gjTOKg0+LhSjSWwWPJIyvamt09wfvW4C64="}