2018-09-25缓存控制Cache-Control
2018-09-25 本文已影响0人
皱皱眉十三流
cache-control是http缓存,通过缓存可以实现web性能优化




首页不能设置cache-control
可能导致用户在一定的时间内没有办法获取最新版的网页,有风险。
使用cache-control
一般设置时间非常长。
当我们要获取最新版本的时候,只需要在请求里加一个查询参数,控制版本。
如

浏览器也会自动清空缓存
cache-control是http缓存,通过缓存可以实现web性能优化
首页不能设置cache-control
可能导致用户在一定的时间内没有办法获取最新版的网页,有风险。
使用cache-control
一般设置时间非常长。
当我们要获取最新版本的时候,只需要在请求里加一个查询参数,控制版本。
如
浏览器也会自动清空缓存