可能的重复:
网络浏览器是否会通过 https 缓存内容
杰夫的最新的编码恐怖文章《打破 Web Cookie Jar》对于任何不熟悉 cookie 工作原理的人来说是一本令人大开眼界的读物。与此类帖子的典型情况一样,评论中充满了 FUD。也就是说,Carl Hörberg 的评论让我感到担忧:
https 的另一个缺点是什么都没有
被缓存在客户端上,所以每个
必须获取 css、图像、js 等
在每个页面加载时。
快速谷歌搜索没有产生任何结果肯定或反驳这一说法,但这可能归因于糟糕的 Google-fu。那么通过 https 提供服务时是否真的不会缓存任何内容?
Possible Duplicate:
Will web browsers cache content over https
Jeff's most recent Coding Horror post Breaking the Web Cookie Jar is an eyeopening read for anyone not familiar with how a cookie works. As is typically the case with a post like this the comments are full of FUD. That said, a comment from Carl Hörberg has me concerned:
Another con with https is that nothing
gets cached on the client, so every
css, image, js etc has to be fetched
on every page load.
A quick Google search yielded no results affirming or contradicting this statement, but that can probably be attributed to poor Google-fu. So is it true that nothing gets cached when served via https?
发布评论
评论(1)
对于 https 请求,客户端通常使用与服务器的单个连接并管道请求,以相同的顺序接收响应。相比之下,对于 http 连接,每个请求有一个连接。当然,除了加密之外,这是主要的区别。没有什么可以阻止客户端使用缓存的响应,尽管服务器可以在指定不缓存的 https 连接上返回响应,但我认为这样做没有意义。
With https requests, the client typically uses a single connection to the server and pipelines requests, receiving responses in the same order. In contrast, with http connections, there is one connection per request. That's the major difference, aside from encryption, of course. There is nothing preventing a client from using cached responses, although it is possible for a server to return responses on https connections that specify no caching, but I don't see a point in doing that.