You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2013/08/26 16:54:17 UTC
svn commit: r1517551 - /httpd/httpd/trunk/docs/manual/mod/mod_deflate.xml
Author: covener
Date: Mon Aug 26 14:54:17 2013
New Revision: 1517551
URL: http://svn.apache.org/r1517551
Log:
remove cache-busting workarounds for ancient browsers. Add more mimetypes to
the "simple" example.
Modified:
httpd/httpd/trunk/docs/manual/mod/mod_deflate.xml
Modified: httpd/httpd/trunk/docs/manual/mod/mod_deflate.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_deflate.xml?rev=1517551&r1=1517550&r2=1517551&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_deflate.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_deflate.xml Mon Aug 26 14:54:17 2013
@@ -38,38 +38,11 @@ client</description>
<seealso><a href="../filter.html">Filters</a></seealso>
<section id="recommended"><title>Sample Configurations</title>
- <p>This is a simple sample configuration for the impatient.</p>
+ <p>This is a simple configuration that compresses common text-based content types.</p>
<example><title>Compress only a few types</title>
<highlight language="config">
- AddOutputFilterByType DEFLATE text/html text/plain text/xml
- </highlight>
- </example>
-
- <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>
-
- <example><title>Compress everything except images</title>
- <highlight language="config">
-<Location />
- # 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
-</Location>
+ AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
</highlight>
</example>
@@ -85,14 +58,9 @@ client</description>
<highlight language="config">
SetOutputFilter DEFLATE
+ SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
</highlight>
- <p>Some popular browsers cannot handle compression of all content
- so you may want to set the <code>gzip-only-text/html</code> note to
- <code>1</code> to only allow html files to be compressed (see
- below). If you set this to <em>anything but <code>1</code></em> it
- will be ignored.</p>
-
<p>If you want to restrict the compression to particular MIME types
in general, you may use the <directive module="mod_filter"
>AddOutputFilterByType</directive> directive. Here is an example of
@@ -105,37 +73,6 @@ client</description>
</Directory>
</highlight>
- <p>For browsers that have problems even with compression of all file
- types, use the <directive module="mod_setenvif"
- >BrowserMatch</directive> directive to set the <code>no-gzip</code>
- note for that particular browser so that no compression will be
- performed. You may combine <code>no-gzip</code> with <code
- >gzip-only-text/html</code> to get the best results. In that case
- the former overrides the latter. Take a look at the following
- excerpt from the <a href="#recommended">configuration example</a>
- defined in the section above:</p>
-
- <highlight language="config">
-BrowserMatch ^Mozilla/4 gzip-only-text/html
-BrowserMatch ^Mozilla/4\.0[678] no-gzip
-BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
- </highlight>
-
- <p>At first we probe for a <code>User-Agent</code> string that
- indicates a Netscape Navigator version of 4.x. These versions
- cannot handle compression of types other than
- <code>text/html</code>. The versions 4.06, 4.07 and 4.08 also
- have problems with decompressing html files. Thus, we completely
- turn off the deflate filter for them.</p>
-
- <p>The third <directive module="mod_setenvif">BrowserMatch</directive>
- directive fixes the guessed identity of the user agent, because
- the Microsoft Internet Explorer identifies itself also as "Mozilla/4"
- but is actually able to handle requested compression. Therefore we
- match against the additional string "MSIE" (<code>\b</code> means
- "word boundary") in the <code>User-Agent</code> Header and turn off
- the restrictions defined before.</p>
-
<note><title>Note</title>
The <code>DEFLATE</code> filter is always inserted after RESOURCE
filters like PHP or SSI. It never touches internal subrequests.