什么是缓存控制:私有? [英] What is Cache-Control: private?

查看:104
本文介绍了什么是缓存控制:私有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我访问 chesseng.herokuapp.com 时,我得到一个看起来像

When I visit chesseng.herokuapp.com I get a response header that looks like

Cache-Control:private
Connection:keep-alive
Content-Encoding:gzip
Content-Type:text/css
Date:Tue, 16 Oct 2012 06:37:53 GMT
Last-Modified:Tue, 16 Oct 2012 03:13:38 GMT
Status:200 OK
transfer-encoding:chunked
Vary:Accept-Encoding
X-Rack-Cache:miss

然后我刷新页面并获得

Cache-Control:private
Connection:keep-alive
Date:Tue, 16 Oct 2012 06:20:49 GMT
Status:304 Not Modified
X-Rack-Cache:miss

所以看起来缓存工作正常。如果这适用于缓存,那么 Expires Cache-Control:max-age 的重点是什么。当我在 https://developers.google.com/speed/上测试页面时,会增加混乱。 pagespeed / insights / 告诉我利用浏览器缓存。

so it seems like caching is working. If that works for caching then what is the point of Expires and Cache-Control:max-age. To add to confusion, when I test the page at https://developers.google.com/speed/pagespeed/insights/ it tells me to "Leverage browser caching".

推荐答案

Cache-Control: private




表示全部或部分响应消息仅供单个用户使用,不得由共享缓存(例如代理服务器)缓存。

Indicates that all or part of the response message is intended for a single user and MUST NOT be cached by a shared cache, such as a proxy server.

来自 RFC2616第14.9.1节

这篇关于什么是缓存控制:私有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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