{
"url": "https://example.com/",
"finalUrl": "https://example.com/",
"statusCode": 200,
"verdict": "heuristically_cacheable",
"cacheControl": {
"raw": null,
"directives": {}
},
"expires": {
"raw": null,
"valid": null
},
"validators": {
"etag": null,
"etagType": null,
"lastModified": "Sun, 04 Oct 2026 07:03:47 GMT"
},
"vary": [],
"age": 2302,
"freshness": {
"browserSeconds": 3518,
"browserSource": "heuristic",
"sharedSeconds": 3518,
"sharedSource": "heuristic"
},
"browserCacheable": true,
"sharedCacheable": true,
"canRevalidate": true,
"cdnHeaders": {
"cf-cache-status": "HIT"
},
"issues": [
{
"severity": "warning",
"code": "no_cache_headers",
"message": "Neither Cache-Control nor Expires is set. Caches fall back to a Last-Modified based heuristic or re-request every time."
},
{
"severity": "info",
"code": "heuristic_freshness",
"message": "No explicit freshness is set, so caches may use roughly 10% of the Last-Modified age as a heuristic lifetime. Behavior can differ between caches."
}
],
"cached": true
}
curl --location --request GET 'https://zylalabs.com/api/14097/cache+headers+analyzer+api/34823/analyze+url+http+cache+headers' --header 'Authorization: Bearer YOUR_API_KEY'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 缓存头分析器 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
该端点返回给定URL的缓存头的结构化分析,包括缓存可用性判定、新鲜度生命周期以及与缓存配置相关的潜在问题列表
关键字段包括 `url`、`finalUrl`、`statusCode`、`verdict`、`cacheControl`、`expires`、`validators`、`vary`、`age`、`freshness`、`browserCacheable`、`sharedCacheable` 和 `issues`,每个字段提供有关缓存行为的特定见解
响应以JSON格式构建,包含用于缓存控制指令、新鲜度值、验证器和问题的嵌套对象,使用户能够轻松解析和理解缓存信息
该端点提供有关缓存能力、新鲜度生命周期、缓存控制指令、过期日期、验证方法,以及在缓存头中检测到的任何配置错误或问题的信息
主要参数是要分析的目标 URL 此外用户可以包含 fresh=1 以绕过缓存结果并获取最新分析
典型的用例包括优化CDN配置 进行性能审计 确保符合缓存标准 以及排除Web应用程序中的缓存问题
数据准确性通过遵循RFC 9111和RFC 9110中列出的规格得以维护,确保分析反映标准缓存行为和实践
用户可以利用返回的数据识别缓存问题 优化缓存设置 并通过理解不同头部如何影响缓存性和新鲜度来改善网站性能