- 浏览器缓存:
加速用户访问,提升单个用户(浏览器访问者)体验,缓存在本地 Nginx缓存
缓存在nginx端,提升所有访问到nginx这一端的用户
提升访问上游(upstream)服务器的速度
用户访问仍然会产生请求流量控制浏览器缓存:
location /files { alias /home/cache; # expires @22h30m; 晚上10点30到期 # expires -1h; 提前1小时过期 # expires epoch; 过期时间(代表没有使用缓存) # expires off;关闭NGINX的缓存 expires 30s; #缓存30秒 expires 30m; #缓存30分钟 expires 2h; #缓存2小时 expires 30d; #缓存30天 expires max; }
本文档由 Jerry.Chen 维护更新