changeset 330:f94bcab2a6ae

Translated ngx_http_gzip_module and ngx_http_gzip_static_module.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 19 Jan 2012 08:50:12 +0000
parents 7571ab5b376e
children d0598d6fe114
files xml/en/GNUmakefile xml/en/docs/http/ngx_http_gzip_module.xml xml/en/docs/http/ngx_http_gzip_static_module.xml xml/en/docs/index.xml xml/en/index.xml
diffstat 5 files changed, 348 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/xml/en/GNUmakefile
+++ b/xml/en/GNUmakefile
@@ -52,6 +52,8 @@ REFS =									\
 		http/ngx_http_empty_gif_module				\
 		http/ngx_http_fastcgi_module				\
 		http/ngx_http_flv_module				\
+		http/ngx_http_gzip_module				\
+		http/ngx_http_gzip_static_module			\
 		http/ngx_http_image_filter_module			\
 		http/ngx_http_index_module				\
 		http/ngx_http_limit_conn_module				\
new file mode 100644
--- /dev/null
+++ b/xml/en/docs/http/ngx_http_gzip_module.xml
@@ -0,0 +1,266 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
+
+<module name="Module ngx_http_gzip_module"
+        link="/en/docs/http/ngx_http_gzip_module.html"
+        lang="en">
+
+<section id="summary">
+
+<para>
+The <literal>ngx_http_gzip_module</literal> module is a filter
+that compresses responses using the “gzip” method.
+This often allows to reduce the size of transmitted data by half or even more.
+</para>
+
+</section>
+
+
+<section id="example" name="Example Configuration">
+
+<para>
+<example>
+    gzip            on;
+    gzip_min_length 1000;
+    gzip_proxied    expired no-cache no-store private auth;
+    gzip_types      text/plain application/xml;
+</example>
+</para>
+
+<para>
+The <var>$gzip_ratio</var> variable can be used to log the
+achieved compression ratio.
+</para>
+
+</section>
+
+
+<section id="directives" name="Directives">
+
+<directive name="gzip">
+<syntax><literal>on</literal> | <literal>off</literal></syntax>
+<default>off</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+<context>if in location</context>
+
+<para>
+Enables or disables gzipping of responses.
+</para>
+
+</directive>
+
+
+<directive name="gzip_buffers">
+<syntax><value>number</value> <value>size</value></syntax>
+<default>32 4k|16 8k</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+Sets the <value>number</value> and <value>size</value> 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.
+<note>
+Until version 0.7.28, four 4K or 8K buffers were used by default.
+</note>
+</para>
+
+</directive>
+
+
+<directive name="gzip_comp_level">
+
+<syntax><value>level</value></syntax>
+<default>1</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+Sets a gzip compression <value>level</value> of a response.
+Acceptable values are in the 1..9 range.
+</para>
+
+</directive>
+
+
+<directive name="gzip_disable">
+<syntax><value>regex</value> ...</syntax>
+<default/>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+<appeared-in>0.6.23</appeared-in>
+
+<para>
+Disables gzipping of responses for requests with
+<header>User-Agent</header> header fields matching
+any of the specified regular expressions.
+</para>
+
+<para>
+The special mask “<literal>msie6</literal>” (0.7.12) corresponds to
+the regular expression “<literal>MSIE [4-6]\.</literal>” but works faster.
+Starting from version 0.8.11, “<literal>MSIE 6.0; ... SV1</literal>”
+is excluded from this mask.
+</para>
+
+</directive>
+
+
+<directive name="gzip_min_length">
+<syntax><value>length</value></syntax>
+<default>20</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+Sets the minimum length of a response that will be gzipped.
+The length is determined only from the <header>Content-Length</header>
+response header field.
+</para>
+
+</directive>
+
+
+<directive name="gzip_http_version">
+<syntax><literal>1.0</literal> | <literal>1.1</literal></syntax>
+<default>1.1</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+Sets the minimum HTTP version of a request required to compress a response.
+</para>
+
+</directive>
+
+
+<directive name="gzip_proxied">
+<syntax>
+  <literal>off</literal> |
+  <literal>expired</literal> |
+  <literal>no-cache</literal> |
+  <literal>no-store</literal> |
+  <literal>private</literal> |
+  <literal>no_last_modified</literal> |
+  <literal>no_etag</literal> |
+  <literal>auth</literal> |
+  <literal>any</literal>
+  ...</syntax>
+<default>off</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+Enables or disables gzipping of responses for proxied
+requests depending on the request and response.
+The fact that the response is proxied is determined based on
+the presence of the <header>Via</header> request header field.
+A directive accepts multiple parameters:
+<list type="tag">
+
+<tag-name><literal>off</literal></tag-name>
+<tag-desc>
+disables compression for all proxied requests,
+ignoring other parameters;
+</tag-desc>
+
+<tag-name><literal>expired</literal></tag-name>
+<tag-desc>
+enables compression if a response header includes the field
+<header>Expires</header> with a value that disables caching;
+</tag-desc>
+
+<tag-name><literal>no-cache</literal></tag-name>
+<tag-desc>
+enables compression if a response header includes the field
+<header>Cache-Control</header> with the parameter “<literal>no-cache</literal>”;
+</tag-desc>
+
+<tag-name><literal>no-store</literal></tag-name>
+<tag-desc>
+enables compression if a response header includes the field
+<header>Cache-Control</header> with the parameter
+“<literal>no-store</literal>”;
+</tag-desc>
+
+<tag-name><literal>private</literal></tag-name>
+<tag-desc>
+enables compression if a response header includes the field
+<header>Cache-Control</header> with the parameter “<literal>private</literal>”;
+</tag-desc>
+
+<tag-name><literal>no_last_modified</literal></tag-name>
+<tag-desc>
+enables compression if a response header does not include the field
+<header>Last-Modified</header>;
+</tag-desc>
+
+<tag-name><literal>no_etag</literal></tag-name>
+<tag-desc>
+enables compression if a response header does not include the field
+<header>ETag</header>;
+</tag-desc>
+
+<tag-name><literal>auth</literal></tag-name>
+<tag-desc>
+enables compression if a request header includes the field
+<header>Authorization</header>;
+</tag-desc>
+
+<tag-name><literal>any</literal></tag-name>
+<tag-desc>
+enables compression for all proxied requests.
+</tag-desc>
+
+</list>
+</para>
+
+</directive>
+
+
+<directive name="gzip_types">
+<syntax><value>mime-type</value> ...</syntax>
+<default>text/html</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+Enables gzipping of responses for the specified MIME types in addition
+to “<literal>text/html</literal>”.
+Responses with the type “<literal>text/html</literal>” are always compressed.
+</para>
+
+</directive>
+
+
+<directive name="gzip_vary">
+<syntax><literal>on</literal> | <literal>off</literal></syntax>
+<default>off</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+Enables or disables emitting the <header>Vary: Accept-Encoding</header>
+response header field if the directives
+<link id="gzip"/> or
+<link doc="ngx_http_gzip_static_module.xml" id="gzip_static"/>
+are active.
+</para>
+
+</directive>
+
+</section>
+
+</module>
new file mode 100644
--- /dev/null
+++ b/xml/en/docs/http/ngx_http_gzip_static_module.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
+
+<module name="Module ngx_http_gzip_static_module"
+        link="/en/docs/http/ngx_http_gzip_static_module.html"
+        lang="en">
+
+<section id="summary">
+
+<para>
+The <literal>ngx_http_gzip_static_module</literal> module allows
+to send precompressed files with the “<literal>.gz</literal>”
+filename extension instead of regular files.
+</para>
+
+<para>
+This module is not built by default, it should be enabled with the
+<literal>--with-http_gzip_static_module</literal>
+configuration parameter.
+</para>
+
+</section>
+
+
+<section id="example" name="Example Configuration">
+
+<para>
+<example>
+    gzip_static  on;
+    gzip_proxied expired no-cache no-store private auth;
+</example>
+</para>
+
+</section>
+
+
+<section id="directives" name="Directives">
+
+<directive name="gzip_static">
+<syntax><literal>on</literal> | <literal>off</literal></syntax>
+<default>off</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+
+<para>
+Enables or disables checking the existence of precompressed files.
+The following directives are also taken into account:
+<link doc="ngx_http_gzip_module.xml" id="gzip_http_version"/>,
+<link doc="ngx_http_gzip_module.xml" id="gzip_proxied"/>,
+<link doc="ngx_http_gzip_module.xml" id="gzip_disable"/>,
+and <link doc="ngx_http_gzip_module.xml" id="gzip_vary"/>.
+</para>
+
+<para>
+The files can be compressed using the <command>gzip</command> command,
+or any other compatible.
+It is recommended that the modification date and time of original and
+compressed files be the same.
+</para>
+
+</directive>
+
+</section>
+
+</module>
--- a/xml/en/docs/index.xml
+++ b/xml/en/docs/index.xml
@@ -110,6 +110,16 @@ ngx_http_flv_module</a>
 </item>
 
 <item>
+<a href="/ru/docs/http/ngx_http_gzip_module.xml">
+ngx_http_gzip_module</a>
+</item>
+
+<item>
+<a href="/ru/docs/http/ngx_http_gzip_static_module.xml">
+ngx_http_gzip_static_module</a>
+</item>
+
+<item>
 <a href="/en/docs/http/ngx_http_image_filter_module.xml">
 ngx_http_image_filter_module</a>
 </item>
--- a/xml/en/index.xml
+++ b/xml/en/index.xml
@@ -63,7 +63,9 @@ load balancing and fault tolerance</link
 
 <item>
 Modular architecture.
-Filters include gzipping, byte ranges, chunked responses, XSLT, SSI,
+Filters include
+<link doc="docs/http/ngx_http_gzip_module.xml">gzipping</link>,
+byte ranges, chunked responses, XSLT, SSI,
 and <link doc="docs/http/ngx_http_image_filter_module.xml">image
 transformation</link> filter.
 Multiple SSI inclusions within a single page can be processed in