SEO web site of compression nginx gzip compression

Website SEO Website for compression nginx gzip compression, gzip compression: the response packet can Enables compression before the file is sent ⾄ client, which can effectively save bandwidth and enhance its responsiveness ⾄ client, compression cpu will consume the nginx performance
1, how to view the site is compressed
SEO web site of compression nginx gzip compression

2, compression grammar
location ~ *.. (Jpg | gif | png | bmp) $ // ~ is case-sensitive match any character at the beginning of the end in .jpg or .bmp, and other types of attention here jgp need gzip_types call
gzip on ; // open gzip compression
gzip_http_version 1.1 // compression protocol version
gzip_comp_level 3; // compression ratio
gzip_types // compression type, defined in accordance /usr/local/nginx/conf/mime.types;

3,开启压缩
server {
listen 80;
server_name www.zymask.com zymask.com;
root /webroot/www;
location ~ .*.(jpg|gif|png|bmp)$ {
gzip on;
gzip_http_version 1.1;
gzip_comp_level 3;
gzip_types text/plain application/json application/x-javascript application/css application/xml application/xml+rss text/javascript application/x-httpd-php image/jpeg image/gif image/png image/x-ms-bmp;
}
}
4,验证
SEO web site of compression nginx gzip compression

Guess you like

Origin blog.51cto.com/13959155/2432482