gzip on;
gzip_min_length 1000;
gzip_buffers 4 8k;
gzip_comp_level 3;
gzip_types text/plain application/x-javascript text/css text/html application/xml text/javascript;
gzip_vary on;
语法: | gzip on | off; |
默认值: |
gzip off;
|
gzip的开关
syntax: | gzip_buffers number size; |
default: |
gzip_buffers 32 4k|16 8k;
|
Sets the number and size of buffers used to compress a response. By default, the buffer size is equal to one memory page. This is either 4K or 8K, depending on a platform.
Until version 0.7.28, four 4K or 8K buffers were used by
default.
syntax: | gzip_comp_level level; |
default: |
gzip_comp_level 1;
|
syntax: | gzip_min_length length; |
default: |
gzip_min_length 20;
|
syntax: | gzip_http_version 1.0 | 1.1; |
default: |
gzip_http_version 1.1;
|
syntax: | gzip_proxied off | expired | no-cache | no-store | private | no_last_modified | no_etag | auth | any ...; |
default: |
gzip_proxied off;
|
- off
- 关闭所有的代理结果数据的压缩
- expired
- 启用压缩,如果header头中包含 "Expires" 头信息
- no-cache
- 启用压缩,如果header头中包含 "Cache-Control:no-cache" 头信息
- no-store
- 启用压缩,如果header头中包含 "Cache-Control:no-store" 头信息
- private
- 启用压缩,如果header头中包含 "Cache-Control:private" 头信息
- no_last_modified
- 启用压缩,如果header头中不包含 "Last-Modified" 头信息
- no_etag
- 启用压缩 ,如果header头中不包含 "ETag" 头信息
- auth
- 用压缩 , 如果header头中包含 "Authorization" 头信息
- any
- 无条件启用压缩
syntax: | gzip_types mime-type ...; |
default: |
gzip_types text/html;
|
syntax: | gzip_vary on | off; |
default: |
gzip_vary off;
|
syntax: | gzip_disable regex ...; |
default: | — |
The special mask “msie6” (0.7.12) corresponds to the regular expression “MSIE [4-6].” but works faster. Starting from version 0.8.11, “MSIE 6.0; ... SV1” is excluded from this mask.
声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。