nginx配置强缓存

it2024-01-29  63

1.设置60s强缓存

location / { # add_header Cache-Control max-age=100; # add_header Cache-Control max-age=60; # add_header Cache-Control no-cache; # add_header Cache-Control private; # add_header Cache-Control max-age=315360000; # add_header Cache-Control no-cache; # expires 30d; # add_header Cache-Control max-age=3600; if ($request_filename ~* ^.*?\.(gif|jpg|jpeg|png|bmp|swf)$){ # add_header Cache-Control no-cache; add_header Cache-Control max-age=60; # expires 30d; } index index.html index.htm; }

2.强缓存的意义可以使得服务器的并发承担高10倍

最新回复(0)