nginx配置强缓存

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倍

猜你喜欢

转载自blog.csdn.net/weixin_43837268/article/details/109195243