【发布时间】:2017-11-24 12:34:02
【问题描述】:
我有点不确定这里发生了什么,但我会尝试解释正在发生的事情,并且一旦我弄清楚我实际上在问什么,也许会写一个更好的问题。
我刚刚安装了 Varnish,这对于我的请求时间来说似乎很棒。这是一个 Magneto 2 商店,我在开发文档中为清漆遵循了默认配置。
我的问题
目前我的问题是浏览器似乎正在缓存页面,直到我单击刷新。我相信我已经成功地用 magento / varnish 刷新 / 清除缓存。当使用 Curl 请求页面时,我可以看到每次刷新缓存时都会生成一个新页面,如果我不这样做,则只提供缓存页面。
在 chrome 和 firefox 中,但是在我的客户端电脑上,整个页面标记似乎被缓存(当单击页面链接或在浏览器中粘贴 url 时),直到单击似乎重新加载真实页面的刷新。当部署新的静态文件等时,旧资源仍在缓存标记中,并且资源的新位置已签名,例如version1234/styles.css 并且不匹配标记我得到的 CSS 较少的页面,直到客户端单击刷新并从服务器加载实际标记?
如何设置缓存以防止这种情况发生?
URL 的 Curl -IL 结果:
HTTP/1.1 200 OK
Date: Fri, 24 Nov 2017 12:08:32 GMT
Strict-Transport-Security: max-age=63072000; includeSubdomains
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Expires: Sun, 26 Nov 2017 15:55:17 GMT
Cache-Control: max-age=186400, public, s-maxage=186400
Pragma: cache
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Vary: Accept-Encoding
X-UA-Compatible: IE=edge
Content-Type: text/html; charset=UTF-8
X-Magento-Cache-Control: max-age=186400, public, s-maxage=186400
X-Magento-Cache-Debug: HIT
Grace: none
age: 0
Accept-Ranges: bytes
Connection: keep-alive
【问题讨论】:
-
请发布
curl -IL your-url的输出 -
@DanielV。添加到问题