HTTP 缓存

HTTP 缓存与条件请求:ETag / If-None-Match(304)、If-Match(412 / 428)、Last-Modified / If-Modified-Since、各种 Cache-Control 以及 Vary。

你的账号已解锁这些端点。在每个端点的页面上用 Try it 发送请求。

这些端点需要一个免费账号。创建账号或登录即可查看详情并在这里试用。

请求示例

Returns the versioned document with its ETag. 完整参考和 Send 按钮(英文).

cURL
curl -X GET "https://api.testingapis.com/api/cache/etag"
响应 · 200 OK
{
  "id": 1,
  "version": 1,
  "title": "TestingAPIs cached document",
  "content": "Send If-None-Match to get a 304, and If-Match on PUT to make a conditional update.",
  "updatedAt": "2025-01-01T00:00:00Z",
  "etag": "\"doc-v1\""
}

登录后查看详情

这些端点的参数、请求和响应示例以及实时 Try it 面板仅对已登录的成员开放。账号免费,几秒钟就能创建。