Nginx 静态资源的缓存

浏览器缓存

HTTP协议定义的缓存机制(Expires;Cache-control等)

浏览器无缓存

第一次进行请求

第二次请求

校验过期机制

整个缓存的过程

配置语法 - expires

添加Cache-Control、Expires头

syntax:  expires [modified]time;
      expires epoch | max|off;
default:     expires off;
context:    http,server,location,if in location

time:过期的周期

此时没有进行设置
测试

 

 

进行配置文件的设置

93c3dbec069bbfbb1d92bac2c0bafded.png  

93c3dbec069bbfbb1d92bac2c0bafded.png

猜你喜欢

转载自www.cnblogs.com/Mrchengs/p/11940382.html