简体   繁体   English

即使使用HTTP无缓存标头,Chrome也会进行缓存

[英]Chrome is caching even with HTTP no-cache headers

I am trying to serve a PHP file output with HTTP Headers configured so the content will NOT be served from cache in Chrome. 我正在尝试使用配置的HTTP标头提供PHP文件输出,因此不会从Chrome中的缓存提供内容。

If I go to Dev tools (in Chrome), and mark the "Disable cache" option, then it works. 如果我转到Dev工具(在Chrome中),并标记“禁用缓存”选项,那么它可以工作。

But I don't want to depend on that, I hope I can setup HTTP headers in a way I can force Chrome to reload the page everytime. 但我不想依赖于此,我希望我可以设置HTTP标头,以便我可以强制Chrome每次重新加载页面。

Here's a screenshot of my current attempt, please note the red marks. 这是我目前尝试的截图,请注意红色标记。

HTTP标头

Could you please provide good documentation or which headers I must declare for this ? 您能否提供好的文件或我必须为此声明的标题?

Thanks in advance. 提前致谢。

Edit 编辑

So I found this other reply too: Chrome caching like a mad browser , but since I recall being told that Chrome needs special headers for Cache-Control , I will keep this question. 所以我也发现了另一个回复: Chrome缓存就像一个疯狂的浏览器 ,但是我记得被告知Chrome需要特殊的Cache-Control标头,我会保留这个问题。

Web browsers can cache AJAX requests with the same request parameters. Web浏览器可以使用相同的请求参数缓存AJAX请求。 In order to work around this problem, use a query string that changes. 若要解决此问题,请使用更改的查询字符串。 One example would be to use the date in seconds as a query parameter. 一个示例是使用以秒为单位的日期作为查询参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么即使在发送无缓存标头后页面仍然缓存? - Why is the page still caching even after the no-cache headers have been sent? Chrome甚至使用Cache-Control来缓存service-worker.js:不存储,不缓存最大年龄:0 - Chrome is caching service-worker.js even with Cache-Control: no-store, no-cache Max-Age: 0 即使设置了正确的缓存控制标头,为什么 Chrome 缓存 302 重定向? - Why is Chrome caching 302 redirect even though proper cache-control headers are set? 如果未设置过期和/或无缓存标头,Google Chrome会缓存资源多长时间? - How long does Google Chrome cache a resource if expires and/or no-cache headers are not set? 与HTTP标头,Chrome,WSGI有关的缓存问题 - Caching issues relating to HTTP headers, Chrome, WSGI 尽管没有缓存标头,但最新的 Chrome 缓存 ajax 响应 - Latest Chrome caching ajax response despite no cache headers IE和Chrome缓存“不缓存”图像 - IE and Chrome caches 'no-cache' images Chrome 正在发送 Cache-control:no-cache 标头 - Chrome is sending Cache-control:no-cache header HTTP请求标头和缓存 - HTTP Request headers and caching Chrome在单击href时添加无缓存标题 - Chrome adding no-cache header when href is clicked
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM