问题描述
通过https请求的内容是否仍会被网络浏览器缓存,还是会考虑这种不安全的行为?如果是这种情况,无论如何都要告诉他们可以缓存吗?
Will content requested over https still be cached by web browsers or do they consider this insecure behaviour? If this is the case is there anyway to tell them it's ok to cache?
推荐答案
默认情况下,Web浏览器应该通过HTTPS缓存内容除非通过收到的明确说明,否则与HTTP相同。
By default web browsers should cache content over HTTPS the same as over HTTP, unless explicitly told otherwise via the HTTP Headers received.
是一个很好的介绍在HTTP标头中设置缓存设置。
This link is a good introduction to setting cache setting in HTTP headers.
这可以通过在 Cache-Control中设置
标头为非零值,例如 max-age
值来实现
This can be achieved by setting the max-age
value in the Cache-Control
header to a non-zero value, e.g.
Cache-Control: max-age=3600
会告诉浏览器此页面可以缓存3600秒(1小时)
will tell the browser that this page can be cached for 3600 seconds (1 hour)
这篇关于Web浏览器是否会通过https缓存内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!