summaryrefslogtreecommitdiff
path: root/docs/manual/mod/mod_deflate.html.en
diff options
context:
space:
mode:
authorStefan Fritsch <sf@sfritsch.de>2014-03-29 21:56:19 +0100
committerStefan Fritsch <sf@sfritsch.de>2014-03-29 21:56:45 +0100
commit2a463b3cd73c32ee9dcd508248d0194923f435f4 (patch)
tree2ff478255a77a55031056790918b6f983bb7b20a /docs/manual/mod/mod_deflate.html.en
parent86d5cc79d9d6750da8771fdb0c9ab22c19b8ad45 (diff)
downloadapache2-upstream/2.4.9.tar.gz
Imported Upstream version 2.4.9upstream/2.4.9
Diffstat (limited to 'docs/manual/mod/mod_deflate.html.en')
-rw-r--r--docs/manual/mod/mod_deflate.html.en91
1 files changed, 25 insertions, 66 deletions
diff --git a/docs/manual/mod/mod_deflate.html.en b/docs/manual/mod/mod_deflate.html.en
index 963b3740..9adc9dc5 100644
--- a/docs/manual/mod/mod_deflate.html.en
+++ b/docs/manual/mod/mod_deflate.html.en
@@ -9,7 +9,7 @@
<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 rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
-<script src="../style/scripts/prettify.js" type="text/javascript">
+<script src="../style/scripts/prettify.min.js" type="text/javascript">
</script>
<link href="../images/favicon.ico" rel="shortcut icon" /></head>
@@ -61,37 +61,14 @@ client</td></tr>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="recommended" id="recommended">Sample Configurations</a></h2>
- <p>This is a simple sample configuration for the impatient.</p>
-
- <div class="example"><h3>Compress only a few types</h3><pre class="prettyprint lang-config">
- AddOutputFilterByType DEFLATE text/html text/plain text/xml
- </pre>
-</div>
-
- <p>The following configuration, while resulting in more compressed content,
- is also much more complicated. Do not use this unless you fully understand
- all the configuration details.</p>
-
- <div class="example"><h3>Compress everything except images</h3><pre class="prettyprint lang-config">
-&lt;Location /&gt;
- # Insert filter
- SetOutputFilter DEFLATE
-
- # Netscape 4.x has some problems...
- BrowserMatch ^Mozilla/4 gzip-only-text/html
-
- # Netscape 4.06-4.08 have some more problems
- BrowserMatch ^Mozilla/4\.0[678] no-gzip
-
- # MSIE masquerades as Netscape, but it is fine
- BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
- # Don't compress images
- SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
-
- # Make sure proxies don't deliver the wrong content
- Header append Vary User-Agent env=!dont-vary
-&lt;/Location&gt;
- </pre>
+ <div class="warning"><h3>Compression and TLS</h3>
+ <p>Some web applications are vulnerable to an information disclosure
+ attack when a TLS connection carries deflate compressed data. For more
+ information, review the details of the "BREACH" family of attacks.</p>
+ </div>
+ <p>This is a simple configuration that compresses common text-based content types.</p>
+
+ <div class="example"><h3>Compress only a few types</h3><pre class="prettyprint lang-config">AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript</pre>
</div>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
@@ -104,9 +81,7 @@ client</td></tr>
will enable compression for documents in the container where it
is placed:</p>
- <pre class="prettyprint lang-config">
- SetOutputFilter DEFLATE
- </pre>
+ <pre class="prettyprint lang-config">SetOutputFilter DEFLATE</pre>
<p>Some popular browsers cannot handle compression of all content
@@ -120,11 +95,9 @@ client</td></tr>
enabling compression only for the html files of the Apache
documentation:</p>
- <pre class="prettyprint lang-config">
-&lt;Directory "/your-server-root/manual"&gt;
+ <pre class="prettyprint lang-config">&lt;Directory "/your-server-root/manual"&gt;
AddOutputFilterByType DEFLATE text/html
-&lt;/Directory&gt;
- </pre>
+&lt;/Directory&gt;</pre>
<p>For browsers that have problems even with compression of all file
@@ -135,11 +108,9 @@ client</td></tr>
excerpt from the <a href="#recommended">configuration example</a>
defined in the section above:</p>
- <pre class="prettyprint lang-config">
-BrowserMatch ^Mozilla/4 gzip-only-text/html
+ <pre class="prettyprint lang-config">BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
-BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
- </pre>
+BrowserMatch \bMSIE !no-gzip !gzip-only-text/html</pre>
<p>At first we probe for a <code>User-Agent</code> string that
@@ -175,12 +146,10 @@ BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
this feature you have to insert the <code>INFLATE</code> filter into
the outputfilter chain using <code class="directive"><a href="../mod/core.html#setoutputfilter">SetOutputFilter</a></code> or <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code>, for example:</p>
- <pre class="prettyprint lang-config">
-&lt;Location /dav-area&gt;
+ <pre class="prettyprint lang-config">&lt;Location /dav-area&gt;
ProxyPass http://example.com/
SetOutputFilter INFLATE
-&lt;/Location&gt;
- </pre>
+&lt;/Location&gt;</pre>
<p>This Example will uncompress gzip'ed output from example.com, so other
@@ -194,11 +163,9 @@ BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
this feature you have to insert the <code>DEFLATE</code> filter into
the input filter chain using <code class="directive"><a href="../mod/core.html#setinputfilter">SetInputFilter</a></code> or <code class="directive"><a href="../mod/mod_mime.html#addinputfilter">AddInputFilter</a></code>, for example:</p>
- <pre class="prettyprint lang-config">
-&lt;Location /dav-area&gt;
+ <pre class="prettyprint lang-config">&lt;Location /dav-area&gt;
SetInputFilter DEFLATE
-&lt;/Location&gt;
- </pre>
+&lt;/Location&gt;</pre>
<p>Now if a request contains a <code>Content-Encoding:
@@ -233,9 +200,7 @@ BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
in a typical configuration where the addition of the <code>DEFLATE</code>
filter depends on the <code>User-Agent</code>, you should add:</p>
- <pre class="prettyprint lang-config">
- Header append Vary User-Agent
- </pre>
+ <pre class="prettyprint lang-config">Header append Vary User-Agent</pre>
<p>If your decision about compression depends on other information
@@ -243,9 +208,7 @@ BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
<code>Vary</code> header to the value <code>*</code>. This prevents
compliant proxies from caching entirely.</p>
- <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">
- Header set Vary *
- </pre>
+ <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">Header set Vary *</pre>
</div>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
@@ -295,12 +258,10 @@ BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
the directive. You can use that note for statistical purposes by
adding the value to your <a href="../logs.html#accesslog">access log</a>.</p>
- <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">
- DeflateFilterNote ratio
+ <div class="example"><h3>Example</h3><pre class="prettyprint lang-config"> DeflateFilterNote ratio
LogFormat '"%r" %b (%{ratio}n) "%{User-agent}i"' deflate
- CustomLog logs/deflate_log deflate
- </pre>
+ CustomLog logs/deflate_log deflate</pre>
</div>
<p>If you want to extract more accurate values from your logs, you
@@ -322,14 +283,12 @@ BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
<p>Thus you may log it this way:</p>
- <div class="example"><h3>Accurate Logging</h3><pre class="prettyprint lang-config">
-DeflateFilterNote Input instream
+ <div class="example"><h3>Accurate Logging</h3><pre class="prettyprint lang-config">DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
-CustomLog logs/deflate_log deflate
-</pre>
+CustomLog logs/deflate_log deflate</pre>
</div>
<h3>See also</h3>
@@ -391,7 +350,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_deflate.html
}
})(window, document);
//--><!]]></script></div><div id="footer">
-<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
+<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
if (typeof(prettyPrint) !== 'undefined') {
prettyPrint();