]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_deflate.xml
Add a comment about the setting of no-gzip.
[apache] / docs / manual / mod / mod_deflate.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <modulesynopsis>
5
6 <name>mod_deflate</name>
7 <description>Compress content before
8     it is delivered to the client</description>
9 <status>Extension</status>
10 <sourcefile>mod_deflate.c</sourcefile>
11 <identifier>deflate_module</identifier>
12
13 <summary>
14     <p>The <module>mod_deflate</module> module provides
15     the <code>DEFLATE</code> output filter that allows output from
16     your server to be compressed before being sent to the client over
17     the network.</p>
18 </summary>
19 <seealso><directive module="mod_mime">AddOutputFilter</directive></seealso>
20 <seealso><directive module="core">SetOutputFilter</directive></seealso>
21
22 <section><title>Enabling Compression</title>
23
24     <p>Compression is implemented by the <code>DEFLATE</code>
25     <a href="../filter.html">filter</a>. The following directive
26     will enable compression for documents in the container where it
27     is placed:</p>
28     <p><strong>Most popular browsers can not handle compression of all content
29         so you may want to set the 'gzip-only-text/html' note to 1 to only 
30         allow html files to be compressed (see below).</strong></p>
31     <p><strong>If you set this to anything but '1' it will be ignored, so you can do
32        negative matches.</strong></p>
33
34 <example>SetEnv gzip-only-text/html 1<br />
35 SetOutputFilter DEFLATE
36 </example>
37
38     <p>Here is an example of enabling compression for the Apache
39     documentation:</p>
40
41 <example>
42 &lt;Directory "/your-server-root/manual"&gt;<br />
43       SetEnv gzip-only-text/html 1<br />
44       SetOutputFilter DEFLATE<br />
45 &lt;/Directory&gt;
46 </example>
47
48     <p>For browsers that have problems even with compression of html files,
49     use the <directive>BrowserMatch</directive> directive to set the 'no-gzip' note
50     for that particular browser so that no compression will be performed.</p>
51 </section>
52
53 <directivesynopsis>
54 <name>DeflateFilterNote</name>
55 <description>Places the compression ratio in a note for logging</description>
56 <syntax>DeflateFilterNote <em>notename</em></syntax>
57 <contextlist><context>server config</context><context>virtual host</context>
58 </contextlist>
59
60 <usage>
61     <p>The <directive>DeflateFilterNote</directive> directive
62     specifies that a note about compression ratios should be attached
63     to the request. The name of the note is the value specified for
64     the directive.</p>
65 </usage>
66 </directivesynopsis>
67
68 <directivesynopsis>
69 <name>DeflateBufferSize</name>
70 <description>Fragment size to be compressed at one time by zlib</description>
71 <syntax>DeflateBufferSize <em>value</em></syntax>
72 <default>DeflateBufferSize 8096</default>
73 <contextlist><context>server config</context><context>virtual host</context>
74 </contextlist>
75
76 <usage>
77     <p>The <directive>DeflateBufferSize</directive> directive specifies
78     the size in bytes of the fragments that zlib should compress at one
79     time.</p>
80 </usage>
81 </directivesynopsis>
82
83 <directivesynopsis>
84 <name>DeflateWindowSize</name>
85 <description>Zlib compression window size</description>
86 <syntax>DeflateWindowSize <em>value</em></syntax>
87 <default>DeflateWindowSize 15</default>
88 <contextlist><context>server config</context><context>virtual host</context>
89 </contextlist>
90
91 <usage>
92     <p>The <directive>DeflateWindowSize</directive> directive specifies the
93     zlib compression window size (a value between 1 and 15).</p>
94 </usage>
95 </directivesynopsis>
96
97 <directivesynopsis>
98 <name>DeflateMemLevel</name>
99 <description>How much memory should be used by zlib for compression</description>
100 <syntax>DeflateMemLevel <em>value</em></syntax>
101 <default>DeflateMemLevel 9</default>
102 <contextlist><context>server config</context><context>virtual host</context>
103 </contextlist>
104
105 <usage>
106     <p>The <directive>DeflateMemLevel</directive> directive specifies
107     how much memory should be used by zlib for compression
108     (a value between 1 and 9).</p>
109 </usage>
110 </directivesynopsis>
111
112 </modulesynopsis>
113