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 />
50 <name>DeflateFilterNote</name>
51 <description>Places the compression ratio in a note for logging</description>
52 <syntax>DeflateFilterNote <em>notename</em></syntax>
53 <contextlist><context>server config</context><context>virtual host</context>
57 <p>The <directive>DeflateFilterNote</directive> directive
58 specifies that a note about compression ratios should be attached
59 to the request. The name of the note is the value specified for
65 <name>DeflateBufferSize</name>
66 <description>Fragment size to be compressed at one time by zlib</description>
67 <syntax>DeflateBufferSize <em>value</em></syntax>
68 <default>DeflateBufferSize 8096</default>
69 <contextlist><context>server config</context><context>virtual host</context>
73 <p>The <directive>DeflateBufferSize</directive> directive specifies
74 the size in bytes of the fragments that zlib should compress at one
80 <name>DeflateWindowSize</name>
81 <description>Zlib compression window size</description>
82 <syntax>DeflateWindowSize <em>value</em></syntax>
83 <default>DeflateWindowSize 15</default>
84 <contextlist><context>server config</context><context>virtual host</context>
88 <p>The <directive>DeflateWindowSize</directive> directive specifies the
89 zlib compression window size (a value between 1 and 15).</p>
94 <name>DeflateMemLevel</name>
95 <description>How much memory should be used by zlib for compression</description>
96 <syntax>DeflateMemLevel <em>value</em></syntax>
97 <default>DeflateMemLevel 9</default>
98 <contextlist><context>server config</context><context>virtual host</context>
102 <p>The <directive>DeflateMemLevel</directive> directive specifies
103 how much memory should be used by zlib for compression
104 (a value between 1 and 9).</p>