Nginx configures strong caching

1. Set 60s strong cache

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. The meaning of strong caching can make the concurrency of the server 10 times higher

Guess you like

Origin blog.csdn.net/weixin_43837268/article/details/109195243