php知识点3-HTTP 头部-Cache-Control
来源:互联网 发布:js点击缩略图显示大图 编辑:程序博客网 时间:2024/06/06 14:11
1.概述
Cache-control用于控制HTTP缓存(在HTTP/1.0中可能部分没实现,仅仅实现了Pragma: no-cache)
2.例子
Cache-Control: cache-directive
cache-directive可以为以下:
request时用到:
no-cache
no-store
max-age = delta-seconds
max-stale = delta-seconds
min-fresh = delta-seconds
no-transform"
only-if-cached"
cache-extension"
response时用到:
public
private = <> field-name <">
no-cache = field-name
no-store"
no-transform
must-revalidate
proxy-revalidate
max-age = delta-seconds
s-maxage = delta-seconds
cache-extension"
3.分析
Cache-control: max-age=5
表示当访问此网页后的5秒内再次访问不会去服务器
Cache-Control: no-cache:这个很容易让人产生误解,使人误以为是响应不被缓存。
实际上Cache-Control: no-cache是会被缓存的,只不过每次在向客户端(浏览器)提供响应数据时,
缓存都要向服务器评估缓存响应的有效性。
Cache-Control: no-store:这个才是响应不被缓存的意思。
0 0
- php知识点3-HTTP 头部-Cache-Control
- php知识点3-HTTP 头部-Accept-Language
- php知识点3-HTTP 头部-Accept
- php知识点3-HTTP 头部-Accept-Encoding
- php知识点3-HTTP 头部-Connection
- php知识点0-HTTP头部
- 【php】HTTP消息头中的“Cache-control”
- php知识点3-HTTP 头部-Accept与Content-Type的区别
- php知识点1-HTTP头部-Content-Type类型
- http 头 Cache-control
- HTTP协议-Cache-Control
- http cache-control
- http Cache-control
- 移动端知识点--Cache-Control
- PHP Cache-control
- HTTP header中的 Cache-control
- HTTP header中的 Cache-control
- Web前端-HTTP Cache-control
- shell script - self learning
- JVM Management API
- Memcache安全配置
- matlab GUI控件代码框架
- System.Properties和System.getenv区别
- php知识点3-HTTP 头部-Cache-Control
- Java拾遗(一):浅析Java子类和父类的实例化顺序 及 陷阱
- 【Leetcode】Additive Number
- iOS中数据库的增删改查
- HDU 2865 Birthday Toy(Polya综合)
- 网络状态检测------苹果官方示例Reachability的使用
- HDOJ 1210 Eddy's 洗牌问题
- php知识点3-HTTP 头部-Accept-Encoding
- 基于Bmob的仿微信即时聊天软件