> For the MDX source of any page, append .mdx to the page URL.
> For a complete documentation index, see https://docs.bitiful.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bitiful.com/_mcp/server.
> If something on this page is wrong or missing, POST JSON {"page": "<page URL>", "message": "<what is wrong>"} to https://docs.bitiful.com/_biti/feedback/agent.

# 预热缓存

`POST /cdn/cache/prefetch`

让 CDN 节点提前回源，把指定 URL 缓存到边缘，适合活动、版本发布、大文件上线前使用，避免第一批访客触发回源。可以立即执行，也可以定时在 24 小时内执行。

每个账户每天（北京时间）可预热 5000 个 URL，与控制台共用额度。列表里有任意一个域名不属于当前账户，整批都会失败。

预热会产生回源流量。预热拉取的是 gzip 版本的缓存；如果边缘已有旧缓存，请先调用刷新缓存接口，刷新完成后再预热。

Base URL: https://api.bitiful.com

Authentication: API key in header `Authorization`

## Request body

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `url_list` | list of URLs | yes | 要预热的完整 URL 列表，必须包含 `http://` 或 `https://` 和域名，规则与刷新 URL 相同。建议每次不超过 100 个，与控制台一致。不支持按目录预热。 |
| `op_time` | integer | no | 定时预热的开始时间，Unix 时间戳，单位**秒**，必须在现在到 24 小时之内。不传或传 `0` 表示立即执行；早于现在 5 分钟以内的时间也按立即执行。 |

## Example request

```bash
curl -X POST https://api.bitiful.com/cdn/cache/prefetch \
     -H "Authorization: <apiKey>" \
     -H "Content-Type: application/json" \
     -d '{
         "url_list": [
           "https://cdn.example.com/release/app-v2.apk",
           "https://cdn.example.com/release/app-v2.ipa"
         ]
       }'
```

## Responses

### 200

预热任务已提交。

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `message` | string | no | 结果或错误说明。 |

### 401

API Token 缺失或无效。

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `message` | string | no | 结果或错误说明。 |

### 403

参数不合法、域名不属于当前账户、额度不足或账户欠费等，原因见 `message`。

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `message` | string | no | 结果或错误说明。 |

### 500

服务端错误，请稍后重试。

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `message` | string | no | 结果或错误说明。 |

### Example response (200)

```json
{
  "message": "ok"
}
```
