Web浏览器是否会通过https缓存内容 [英] Will web browsers cache content over https

查看:441
本文介绍了Web浏览器是否会通过https缓存内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过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标头明确说明,否则与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.


无论如何都告诉他们可以缓存吗?

is there anyway to tell them it's ok to cache?

这可以通过在 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缓存内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆