小编Muh*_*hym的帖子

尽管在响应标头中从服务器发送了 no-cache、no-store、must-revalidate,但我的浏览器仍然显示缓存页面

我们页面上的内容不断变化,因此我们不希望浏览器缓存页面或显示缓存页面或我们的用户。但是,尽管在响应标头中从服务器发送了 no-cache、no-store、must-revalidate,但浏览器仍然显示缓存的页面。\n这确实令人沮丧。我们有成千上万的用户,他们都在阅读旧新闻!

\n

我们正在使用客户端 js 模板(handlebars js)从服务器读取数据并渲染页面,但浏览器不断向用户显示最后渲染的页面,而 Handlebars 既不从服务器读取新数据,也不更新内容。可能出什么问题了?

\n

如果我按shift重新加载,那么浏览器确实会显示新内容,但我不能要求或期望我的用户每次加载我们的页面时都这样做。

\n

有人可以提供有用的指点吗?

\n

200 好

\n

响应头:

\n
Accept-Ranges: bytes\nCache-Control: no-cache, no-store, must-revalidate\nConnection: keep-alive\nContent-Length: 12229\nContent-Type: text/html\nDate: Fri, 14 Aug 2020 09:08:10 GMT\nETag: "1e9602c3ddcf81c338fa4194c61ea035"\nLast-Modified: Fri, 07 Aug 2020 12:38:22 GMT\nServer: nginx/1.19.1\nStrict-Transport-Security: max-age=0; includeSubDomains\nVary: Origin, Access-Control-Request-Headers, Access-Control-Request-Method\nx-amz-request-id: tx00000000000004b9d2b06-005f36547a-ab8956-ams3b\nx-rgw-object-type: Normal\n
Run Code Online (Sandbox Code Playgroud)\n

请求标头:

\n
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\nAccept-Encoding: gzip, deflate\nAccept-Language: en-GB,en-US;q=0.9,en;q=0.8\nCache-Control: max-age=0\nConnection: keep-alive\nCookie: _ga=GA1.1.709310680.1596978913; _gid=GA1.1.2045080055.1596978913\nUpgrade-Insecure-Requests: 1\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36\n(index):48 [Violation] Avoid using document.write(). https://developers.google.com/web/updates/2016/08/removing-document-write\n
Run Code Online (Sandbox Code Playgroud)\n

\xe2\x80\x8b\n我们正在执行 …

nginx cache http-headers

1
推荐指数
1
解决办法
9801
查看次数

标签 统计

cache ×1

http-headers ×1

nginx ×1