]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_deflate.html.en
3ea1cbd2bc5f31eeb2f1acffba4538fd06d09187
[apache] / docs / manual / mod / mod_deflate.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       --><title>mod_deflate - Apache HTTP Server</title><link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /><link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /><link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link href="../images/favicon.ico" rel="shortcut icon" /></head><body><div id="page-header"><p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p><p class="apache">Apache HTTP Server Version 2.0</p><img alt="" src="../images/feather.gif" /></div><div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div><div id="path"><a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs-project/">Documentation</a> &gt; <a href="../">Version 2.0</a> &gt; <a href="./">Modules</a></div><div id="page-content"><div id="preamble"><h1>Apache Module mod_deflate</h1><table class="module"><tr><th><a href="module-dict.html#Description">Description:
8                   </a></th><td>Compress content before
9     it is delivered to the client</td></tr><tr><th><a href="module-dict.html#Status">Status:
10                   </a></th><td>Extension</td></tr><tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:
11                   </a></th><td>deflate_module</td></tr><tr><th><a href="module-dict.html#SourceFile">Source File:
12                   </a></th><td>mod_deflate.c</td></tr></table><h3>Summary</h3>
13     <p>The <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code> module provides
14     the <code>DEFLATE</code> output filter that allows output from
15     your server to be compressed before being sent to the client over
16     the network.</p>
17 </div><div id="quickview"><h3 class="directives">Directives</h3><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#deflatebuffersize">DeflateBufferSize</a></li><li><img alt="" src="../images/down.gif" /> <a href="#deflatefilternote">DeflateFilterNote</a></li><li><img alt="" src="../images/down.gif" /> <a href="#deflatememlevel">DeflateMemLevel</a></li><li><img alt="" src="../images/down.gif" /> <a href="#deflatewindowsize">DeflateWindowSize</a></li></ul><h3>Topics</h3><ul id="topics"><li><img alt="" src="../images/down.gif" /> Enabling Compression</li></ul><h3>See also</h3><ul class="seealso"><li><code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code></li><li><code class="directive"><a href="../mod/core.html#setoutputfilter">SetOutputFilter</a></code></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="section"><h2>Enabling Compression</h2>
18
19     <p>Compression is implemented by the <code>DEFLATE</code>
20     <a href="../filter.html">filter</a>. The following directive
21     will enable compression for documents in the container where it
22     is placed:</p>
23     <p><strong>Most popular browsers can not handle compression of all content
24         so you may want to set the 'gzip-only-text/html' note to 1 to only 
25         allow html files to be compressed (see below).</strong></p>
26     <p><strong>If you set this to anything but '1' it will be ignored, so you can do
27        negative matches.</strong></p>
28
29 <div class="example"><p><code>SetEnv gzip-only-text/html 1<br />
30 SetOutputFilter DEFLATE
31 </code></p></div>
32
33     <p>Here is an example of enabling compression for the Apache
34     documentation:</p>
35
36 <div class="example"><p><code>
37 &lt;Directory "/your-server-root/manual"&gt;<br />
38       SetEnv gzip-only-text/html 1<br />
39       SetOutputFilter DEFLATE<br />
40 &lt;/Directory&gt;
41 </code></p></div>
42 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="DeflateBufferSize" id="DeflateBufferSize">DeflateBufferSize</a> <a name="deflatebuffersize" id="deflatebuffersize">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description: 
43               </a></th><td>Fragment size to be compressed at one time by zlib</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
44               </a></th><td>DeflateBufferSize <em>value</em></td></tr><tr><th><a href="directive-dict.html#Default">Default: 
45               </a></th><td><code>DeflateBufferSize 8096</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
46               </a></th><td>server config, virtual host</td></tr><tr><th><a href="directive-dict.html#Status">Status:
47               </a></th><td>Extension</td></tr><tr><th><a href="directive-dict.html#Module">Module:
48               </a></th><td>mod_deflate</td></tr></table>
49     <p>The <code class="directive">DeflateBufferSize</code> directive specifies
50     the size in bytes of the fragments that zlib should compress at one
51     time.</p>
52 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="DeflateFilterNote" id="DeflateFilterNote">DeflateFilterNote</a> <a name="deflatefilternote" id="deflatefilternote">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description: 
53               </a></th><td>Places the compression ratio in a note for logging</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
54               </a></th><td>DeflateFilterNote <em>notename</em></td></tr><tr><th><a href="directive-dict.html#Context">Context:
55               </a></th><td>server config, virtual host</td></tr><tr><th><a href="directive-dict.html#Status">Status:
56               </a></th><td>Extension</td></tr><tr><th><a href="directive-dict.html#Module">Module:
57               </a></th><td>mod_deflate</td></tr></table>
58     <p>The <code class="directive">DeflateFilterNote</code> directive
59     specifies that a note about compression ratios should be attached
60     to the request. The name of the note is the value specified for
61     the directive.</p>
62 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="DeflateMemLevel" id="DeflateMemLevel">DeflateMemLevel</a> <a name="deflatememlevel" id="deflatememlevel">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description: 
63               </a></th><td>How much memory should be used by zlib for compression</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
64               </a></th><td>DeflateMemLevel <em>value</em></td></tr><tr><th><a href="directive-dict.html#Default">Default: 
65               </a></th><td><code>DeflateMemLevel 9</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
66               </a></th><td>server config, virtual host</td></tr><tr><th><a href="directive-dict.html#Status">Status:
67               </a></th><td>Extension</td></tr><tr><th><a href="directive-dict.html#Module">Module:
68               </a></th><td>mod_deflate</td></tr></table>
69     <p>The <code class="directive">DeflateMemLevel</code> directive specifies
70     how much memory should be used by zlib for compression
71     (a value between 1 and 9).</p>
72 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="DeflateWindowSize" id="DeflateWindowSize">DeflateWindowSize</a> <a name="deflatewindowsize" id="deflatewindowsize">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description: 
73               </a></th><td>Zlib compression window size</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:
74               </a></th><td>DeflateWindowSize <em>value</em></td></tr><tr><th><a href="directive-dict.html#Default">Default: 
75               </a></th><td><code>DeflateWindowSize 15</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:
76               </a></th><td>server config, virtual host</td></tr><tr><th><a href="directive-dict.html#Status">Status:
77               </a></th><td>Extension</td></tr><tr><th><a href="directive-dict.html#Module">Module:
78               </a></th><td>mod_deflate</td></tr></table>
79     <p>The <code class="directive">DeflateWindowSize</code> directive specifies the
80     zlib compression window size (a value between 1 and 15).</p>
81 </div></div><div id="footer"><p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p><p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div></body></html>