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

查看:31
本文介绍了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 浏览器应该像通过 HTTP 一样缓存 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.

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

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天全站免登陆