Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_gzip_module.xml @ 966:95c3c3bbf1ce
Text review.
author | Egor Nikitin <yegor.nikitin@gmail.com> |
---|---|
date | Wed, 14 Aug 2013 12:03:41 +0400 |
parents | ae15915990ad |
children | 6d51bb4f19f7 |
comparison
equal
deleted
inserted
replaced
965:fadccc156188 | 966:95c3c3bbf1ce |
---|---|
15 <section id="summary"> | 15 <section id="summary"> |
16 | 16 |
17 <para> | 17 <para> |
18 The <literal>ngx_http_gzip_module</literal> module is a filter | 18 The <literal>ngx_http_gzip_module</literal> module is a filter |
19 that compresses responses using the “gzip” method. | 19 that compresses responses using the “gzip” method. |
20 This often allows to reduce the size of transmitted data by half or even more. | 20 This often helps to reduce the size of transmitted data by half or even more. |
21 </para> | 21 </para> |
22 | 22 |
23 </section> | 23 </section> |
24 | 24 |
25 | 25 |
87 <context>server</context> | 87 <context>server</context> |
88 <context>location</context> | 88 <context>location</context> |
89 | 89 |
90 <para> | 90 <para> |
91 Sets a gzip compression <value>level</value> of a response. | 91 Sets a gzip compression <value>level</value> of a response. |
92 Acceptable values are in the 1..9 range. | 92 Acceptable values are in the range from 1 to 9. |
93 </para> | 93 </para> |
94 | 94 |
95 </directive> | 95 </directive> |
96 | 96 |
97 | 97 |
109 any of the specified regular expressions. | 109 any of the specified regular expressions. |
110 </para> | 110 </para> |
111 | 111 |
112 <para> | 112 <para> |
113 The special mask “<literal>msie6</literal>” (0.7.12) corresponds to | 113 The special mask “<literal>msie6</literal>” (0.7.12) corresponds to |
114 the regular expression “<literal>MSIE [4-6]\.</literal>” but works faster. | 114 the regular expression “<literal>MSIE [4-6]\.</literal>”, but works faster. |
115 Starting from version 0.8.11, “<literal>MSIE 6.0; ... SV1</literal>” | 115 Starting from version 0.8.11, “<literal>MSIE 6.0; ... SV1</literal>” |
116 is excluded from this mask. | 116 is excluded from this mask. |
117 </para> | 117 </para> |
118 | 118 |
119 </directive> | 119 </directive> |
167 <context>location</context> | 167 <context>location</context> |
168 | 168 |
169 <para> | 169 <para> |
170 Enables or disables gzipping of responses for proxied | 170 Enables or disables gzipping of responses for proxied |
171 requests depending on the request and response. | 171 requests depending on the request and response. |
172 The fact that the response is proxied is determined based on | 172 The fact that the response is proxied is determined by |
173 the presence of the <header>Via</header> request header field. | 173 the presence of the <header>Via</header> request header field. |
174 A directive accepts multiple parameters: | 174 A directive accepts multiple parameters: |
175 <list type="tag"> | 175 <list type="tag"> |
176 | 176 |
177 <tag-name><literal>off</literal></tag-name> | 177 <tag-name><literal>off</literal></tag-name> |
180 ignoring other parameters; | 180 ignoring other parameters; |
181 </tag-desc> | 181 </tag-desc> |
182 | 182 |
183 <tag-name><literal>expired</literal></tag-name> | 183 <tag-name><literal>expired</literal></tag-name> |
184 <tag-desc> | 184 <tag-desc> |
185 enables compression if a response header includes the field | 185 enables compression if a response header includes the |
186 <header>Expires</header> with a value that disables caching; | 186 <header>Expires</header> field with a value that disables caching; |
187 </tag-desc> | 187 </tag-desc> |
188 | 188 |
189 <tag-name><literal>no-cache</literal></tag-name> | 189 <tag-name><literal>no-cache</literal></tag-name> |
190 <tag-desc> | 190 <tag-desc> |
191 enables compression if a response header includes the field | 191 enables compression if a response header includes the |
192 <header>Cache-Control</header> with the parameter “<literal>no-cache</literal>”; | 192 <header>Cache-Control</header> field with the |
193 “<literal>no-cache</literal>” parameter; | |
193 </tag-desc> | 194 </tag-desc> |
194 | 195 |
195 <tag-name><literal>no-store</literal></tag-name> | 196 <tag-name><literal>no-store</literal></tag-name> |
196 <tag-desc> | 197 <tag-desc> |
197 enables compression if a response header includes the field | 198 enables compression if a response header includes the |
198 <header>Cache-Control</header> with the parameter | 199 <header>Cache-Control</header> field with the |
199 “<literal>no-store</literal>”; | 200 “<literal>no-store</literal>” parameter; |
200 </tag-desc> | 201 </tag-desc> |
201 | 202 |
202 <tag-name><literal>private</literal></tag-name> | 203 <tag-name><literal>private</literal></tag-name> |
203 <tag-desc> | 204 <tag-desc> |
204 enables compression if a response header includes the field | 205 enables compression if a response header includes the |
205 <header>Cache-Control</header> with the parameter “<literal>private</literal>”; | 206 <header>Cache-Control</header> field with the |
207 “<literal>private</literal>” parameter; | |
206 </tag-desc> | 208 </tag-desc> |
207 | 209 |
208 <tag-name><literal>no_last_modified</literal></tag-name> | 210 <tag-name><literal>no_last_modified</literal></tag-name> |
209 <tag-desc> | 211 <tag-desc> |
210 enables compression if a response header does not include the field | 212 enables compression if a response header does not include the |
211 <header>Last-Modified</header>; | 213 <header>Last-Modified</header> field; |
212 </tag-desc> | 214 </tag-desc> |
213 | 215 |
214 <tag-name><literal>no_etag</literal></tag-name> | 216 <tag-name><literal>no_etag</literal></tag-name> |
215 <tag-desc> | 217 <tag-desc> |
216 enables compression if a response header does not include the field | 218 enables compression if a response header does not include the |
217 <header>ETag</header>; | 219 <header>ETag</header> field; |
218 </tag-desc> | 220 </tag-desc> |
219 | 221 |
220 <tag-name><literal>auth</literal></tag-name> | 222 <tag-name><literal>auth</literal></tag-name> |
221 <tag-desc> | 223 <tag-desc> |
222 enables compression if a request header includes the field | 224 enables compression if a request header includes the |
223 <header>Authorization</header>; | 225 <header>Authorization</header> field; |
224 </tag-desc> | 226 </tag-desc> |
225 | 227 |
226 <tag-name><literal>any</literal></tag-name> | 228 <tag-name><literal>any</literal></tag-name> |
227 <tag-desc> | 229 <tag-desc> |
228 enables compression for all proxied requests. | 230 enables compression for all proxied requests. |
243 | 245 |
244 <para> | 246 <para> |
245 Enables gzipping of responses for the specified MIME types in addition | 247 Enables gzipping of responses for the specified MIME types in addition |
246 to “<literal>text/html</literal>”. | 248 to “<literal>text/html</literal>”. |
247 The special value “<literal>*</literal>” matches any MIME type (0.8.29). | 249 The special value “<literal>*</literal>” matches any MIME type (0.8.29). |
248 Responses with the type “<literal>text/html</literal>” are always compressed. | 250 Responses with the “<literal>text/html</literal>” type are always compressed. |
249 </para> | 251 </para> |
250 | 252 |
251 </directive> | 253 </directive> |
252 | 254 |
253 | 255 |
257 <context>http</context> | 259 <context>http</context> |
258 <context>server</context> | 260 <context>server</context> |
259 <context>location</context> | 261 <context>location</context> |
260 | 262 |
261 <para> | 263 <para> |
262 Enables or disables emitting the <header>Vary: Accept-Encoding</header> | 264 Enables or disables inserting the <header>Vary: Accept-Encoding</header> |
263 response header field if the directives | 265 response header field if the directives |
264 <link id="gzip"/>, | 266 <link id="gzip"/>, |
265 <link doc="ngx_http_gzip_static_module.xml" id="gzip_static"/>, or | 267 <link doc="ngx_http_gzip_static_module.xml" id="gzip_static"/>, or |
266 <link doc="ngx_http_gunzip_module.xml" id="gunzip"/> | 268 <link doc="ngx_http_gunzip_module.xml" id="gunzip"/> |
267 are active. | 269 are active. |
277 <para> | 279 <para> |
278 <list type="tag"> | 280 <list type="tag"> |
279 | 281 |
280 <tag-name id="var_gzip_ratio"><var>$gzip_ratio</var></tag-name> | 282 <tag-name id="var_gzip_ratio"><var>$gzip_ratio</var></tag-name> |
281 <tag-desc>achieved compression ratio, computed as the ratio between the | 283 <tag-desc>achieved compression ratio, computed as the ratio between the |
282 original and compressed response size.</tag-desc> | 284 original and compressed response sizes.</tag-desc> |
283 | 285 |
284 </list> | 286 </list> |
285 </para> | 287 </para> |
286 | 288 |
287 </section> | 289 </section> |