[英]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. 这是我目前尝试的截图,请注意红色标记。
Could you please provide good documentation or which headers I must declare for this ? 您能否提供好的文件或我必须为此声明的标题?
Thanks in advance. 提前致谢。
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.