【发布时间】:2015-11-11 23:46:42
【问题描述】:
我有几个包含敏感数据的网站,所以我想完全禁用客户端缓存。我发现 google 上有 3 个用于 Http/1.1 的实现:
-
实施1:与其他人一起设置“无商店”
response.setHeader("Cache-Control", "no-store, no-cache, max-age=0, must-revalidate"); -
实现2:设置“无存储,无缓存”
response.setHeader("Cache-Control", "no-store, no-cache"); // REASON is "no-cache" already cover this "max-age=0, must-revalidate" -
实现3:设置“无存储”:
response.setHeader("Cache-Control", "no-store"); // REASON is: "no-store": data is never stored // on both client cache & intermediate caches
我找到了这张图(来自谷歌网站:Cache Control Policy Diagram)
从这张图中,我的理解是实现 3 对 HTTP/1.1 来说已经足够了
有没有cmets?谢谢!
【问题讨论】:
标签: java browser-cache cache-control http-1.1 disable-caching