2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
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>
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
19 <seealso><directive module="mod_mime">AddOutputFilter</directive></seealso>
20 <seealso><directive module="core">SetOutputFilter</directive></seealso>
22 <section><title>Enabling Compression</title>
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
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>
34 <example>SetEnv gzip-only-text/html 1<br />
35 SetOutputFilter DEFLATE
38 <p>Here is an example of enabling compression for the Apache
42 <Directory "/your-server-root/manual"><br />
43 SetEnv gzip-only-text/html 1<br />
44 SetOutputFilter DEFLATE<br />
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>
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>
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
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>
77 <p>The <directive>DeflateBufferSize</directive> directive specifies
78 the size in bytes of the fragments that zlib should compress at one
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>
92 <p>The <directive>DeflateWindowSize</directive> directive specifies the
93 zlib compression window size (a value between 1 and 15).</p>
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>
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>