response headers设置Expires<br>
Http响应头中包含的属性
浏览器会返回下载时间、过期时间,浏览器根据此来决定是否请求服务器
HTTP1.0的东西,现在基本上用的都是HTTP1.1
response headers设置Cache-control<br>
可能存在的值
public<br>
private<br>
no-cache
no-store<br>
no-transform<br>
must-revalidate<br>
proxy-revalidate
max-age
案例
自定义页面
cache-control: max-age=3600
表示:缓存3600s
原理:根据请求头的参数来判断请求的资源是否修改过,如果没有修改过则返回客户端304,此时客户端会使用本地缓存。
静态资源
可以使用spring mvc配置过期时间,浏览器会识别