查看缓存数据
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本指南介绍了如何使用 Chrome 开发者工具检查 Cache 数据。
如果您尝试检查 HTTP 缓存数据,这并非您所需要的指南。网络日志的大小列中包含您要查找的信息。请参阅记录网络活动。
查看缓存数据
打开开发者工具 > Application > Storage。
如需查看可用的缓存,请展开
Cache Storage。
![可用的缓存。](https://developer.chrome.com/static/docs/devtools/storage/cache/image/available-caches-edb1a6c17b196.png?authuser=5&hl=zh-cn)
点击缓存即可查看其内容。
![查看缓存的内容。](https://developer.chrome.com/static/docs/devtools/storage/cache/image/viewing-caches-contents-d8f5daa92cf44.png?authuser=5&hl=zh-cn)
点击一项资源即可在表格下方的部分中查看其 HTTP 标头。
![查看资源的 HTTP 标头。](https://developer.chrome.com/static/docs/devtools/storage/cache/image/viewing-resources-http-7ab3484155b01.png?authuser=5&hl=zh-cn)
打开预览标签页以查看资源的内容。
![查看资源的内容。](https://developer.chrome.com/static/docs/devtools/storage/cache/image/viewing-resources-conte-a63b79c240c.png?authuser=5&hl=zh-cn)
刷新资源
- 查看缓存的数据。
选择要刷新的资源。开发者工具会将其突出显示为蓝色,表示其已被选中。
![选择资源。](https://developer.chrome.com/static/docs/devtools/storage/cache/image/selecting-resource-2bbf13760e0af.png?authuser=5&hl=zh-cn)
点击 Refreshrefresh(刷新)。
过滤资源
- 查看缓存的数据。
- 使用按路径过滤文本框过滤出与您提供的路径不匹配的所有资源。
![过滤掉与指定路径不匹配的资源。](https://developer.chrome.com/static/docs/devtools/storage/cache/image/filtering-resources-do-60c3d293f759a.png?authuser=5&hl=zh-cn)
以下示例会过滤掉路径中不包含 script
的资源。
删除一项资源
- 查看缓存的数据。
点击要删除的资源。开发者工具会将其突出显示为蓝色,表示其已被选中。
![选择要删除的资源。](https://developer.chrome.com/static/docs/devtools/storage/cache/image/selecting-resource-dele-fac7562b900ba.png?authuser=5&hl=zh-cn)
点击删除所选内容
。
删除所有缓存数据
- 依次打开 Application > Storage。
在缓存部分,确保已启用
缓存存储空间。
点击清除网站数据。
![“缓存存储空间”复选框和“清除网站数据”按钮。](https://developer.chrome.com/static/docs/devtools/storage/cache/image/the-cache-storage-checkbo-fc0e3720fd4a9.png?authuser=5&hl=zh-cn)
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2019-03-25。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]