"Fossies" - the Fresh Open Source Software Archive

Member "mod_gzip-" (30 Sep 2002, 8647 Bytes) of package /linux/www/apache_httpd_modules/old/mod_gzip-

As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

A hint: This file contains one or more very long lines, so maybe it is better readable using the pure text view mode that shows the contents as wrapped lines within the browser window.

    1 <?xml version="1.0" encoding="iso-8859-1" ?>
    2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    3 <html xmlns="http://www.w3.org/1999/xhtml">
    5 <head>
    6  <title>Possible enhancements in future versions of mod_gzip</title>
    7  <meta name="author"      content="Michael Schr&ouml;pl" />
    8  <meta name="description" content="A list of (hopefully) reasonable and probably easy to implement functional enhancements for further mod_gzip versions" />
    9  <meta name="keywords"    content="Apache, HTTP, encoding, gzip, compression" />
   10  <style type="text/css">
   11 body{font-family:sans-serif;margin:0px 30px 0px 30px;}
   12 h1{font-size:22px;margin-top:20px;}
   13 h2{font-size:18px;margin-top:14px;}
   14 small{font-size:80%;}
   15 td{vertical-align:top;}
   16 tt{font-weight:bold;}
   17 code,tt{font-family:"Courier New",monospace;}
   18 h1,h2{margin-bottom:1px;}
   19 p,td{margin-top:3px;margin-bottom:3px;}
   20 p,ul,ol,li{font-size:17px;line-height:22px;}
   21 ul,ol,li{margin-top:0px;margin-bottom:0px;}
   22 img{border-width:0;}
   24 #nav{position:absolute;top:30px;left:0px;font-size:14px;width:170px;font-weight:bold;margin:2px 2px 2px 30px;}
   25 #nav[id]{position:fixed;}
   26 #nav img{margin:5px;}
   27 #nav p, #nav a:hover, #nav a{display:block;padding:3px;margin:2px;width:150px;font-size:15px;line-height:18px;}
   28 #content{position:absolute;left:220px;right:30px;}
   29 #mail{text-align:right;}
   30 #icon{width:190px;float:left;}
   31 #mail,#icon{margin-top:30px;}
   33 @media screen {
   34 body{color:#000;background-color:#f8ebd9;}
   35 h1{color:#666;}
   36 h2{color:#840;}
   37 code{color:#333;}
   38 em{color:#900;}
   39 tt{color:#909;}
   40 h1,h2,code,em,tt{background-color:inherit;}
   41 .new13192a{color:#inherit;background-color:#ffd;}
   42 .new13261a{color:#inherit;background-color:#eff;}
   43 .bugfix{color:#fff;background-color:#f00;font-weight:bold;padding:0px 4px;}
   44 #nav a{color:#530;background-color:transparent;}
   45 #nav a{text-decoration:none;}
   46 #nav p, #nav a:hover{color:#000;background-color:#fff;}
   47 #nav p {border:1px #660 solid;}
   48 #nav a {border:1px #666 dotted;}
   49 }
   51 @media print {
   52 #icon,#nav{display:none;}
   53 #content{position:absolute;left:0px;right:0px;}
   54 }
   55  </style>
   56 </head>
   58 <body>
   60 <div id="nav">
   62 <img src="mod_gzip_logo.gif" height="47" width="102" alt="mod_gzip logo" />
   65 <a title="mod_gzip - what's that, anyway?" href="index.htm">mod_gzip</a>
   69 <a title="Compression of HTTP content using Content-Encoding" href="encoding.htm">Content-Encoding</a>
   73 <a title="Which browsers can handle 'Content-Encoding: gzip'?" href="browser.htm">Browsers</a>
   77 <a title="How do Firewalls handle 'Content-Encoding:'?" href="firewalls.htm">Firewalls</a>
   81 <a title="An example configuration for mod_gzip" href="config.htm">Configuration</a>
   85 <a title="Complete description of mod_gzip status codes" href="status.htm">Status Codes</a>
   89 <p>Enhancements</p>
   93 <a title="Caching of negotiated HTTP responses" href="cache.htm">Caching</a>
   97 <a title="Version history and change log for mod_gzip" href="versions.htm">Versions</a>
  101 <a title="Other ressources about mod_gzip" href="links.htm">Links</a>
  104 </div>
  106 <div id="content">
  108 <h1>Possible enhancements in future versions of <tt>mod_gzip</tt></h1>
  110 <p>This document describes some possible functional enhancements which hopefully could be implemented into the current version of <tt>mod_gzip</tt> without too much effort and enhance the usability of this module.</p>
  112 <h2><a id="rule_logging"></a>Logging class and value of the decisive filter rule</h2>
  113 <p>The decision about whether a document content qualifies for compression by <tt>mod_gzip</tt> is finally done during the evaluation of the filter rules defined by the directives <code>mod_gzip_item_include</code> and <code>mod_gzip_item_exclude</code> which are checked by the function <code>mod_gzip_validate1</code>.</p>
  114 <p>But this function is invoked at no less than five positions within the source code, each time with different parameter settings for specific parts of the rules classes to be checked at that moment. In some of these cases it is clear from the restricted parameter setting which rule class must have led to the specific result <small>(but not which rule value!)</small>, in other cases <small>(such as the simultaneous test of all rules of the classes <code>file</code>, <code>uri</code>, <code>mime</code> and <code>handler</code>)</small> not even the class of the decisive rule is clear <small>(because <code>mod_gzip_validate1</code> returns such an unspecific result value to the caller that this one cannot even understand what exactly has happened - in some cases even internal errors are encoded like a decision because of an exclusion rule)</small>. In these cases not even a reasonable evaluation of the <tt>mod_gzip</tt> status code is possible.</p>
  115 <p>But the definition of an appropriate rule set is the most important step during the complete <small>(and currently still rather complicated)</small> <tt>mod_gzip</tt> configuration procedure. Any information about which one of the defined rules decided in which cases about whether a document content was to be compressed would be helpful for the user in many cases.</p>
  116 <p>On the other hand <tt>mod_gzip</tt> already supports processing transparency <em>after</em> successfully handling a document by setting some variables which can be used in Apache log formats <small>(the processing status, the document sizes before and after compression as well as the volume saving in percent - the last one erroneously <em>always</em> rounded up)</small>. According to this <tt>mod_gzip</tt> could <small>(just in the moment when the decision about compressing the document content was made)</small> easily store class and content of the decisive rule into two more log variables which would then be addressed withing a log format via the names <code>mod_gzip_rule_class</code> and <code>mod_gzip_rule_content</code>.</p>
  118 <h2><a id="gzip_level"></a>Configurable gzip compression level</h2>
  119 <p>Currently <tt>mod_gzip</tt> uses the <code>gzip</code> compression level 6. This is hard-coded by the assignment <code>gz1-&gt;level = 6</code> inside the function <code>gz1_init</code>.</p>
  120 <p>The higher the compression level, <small>(<code>gzip</code> normally allows values between 0 and 9)</small>, the better the compression effect, but the higher the CPU time consumption as well. By adapting this compression level a user could solve the trade-off between CPU load and bandwidth saving according to his own requirements. Own experiments have shown that level 3 already takes you near the effect of compression level 6 - at least the choice between these two values should be left to the user.</p>
  121 <p>Thus it would be reasonable to have this compression level configurable by offering another directive <code>mod_gzip_compression_level</code>.</p>
  123 <h2><a id="boolean_rules"></a>Boolean expressions in <code>include</code>/<code>exclude</code> directives</h2>
  124 <p><tt>mod_gzip</tt> uses - caused by its way of being embedded inside the Apache request handling - a complex, two-level filter procedure to decide whether the result of a request should be compressed. <small>(In a modified architecture of Apache 2.0 a simpler way of embedding might be possible.)</small></p>
  125 <p>A request currently will be accepted by  <tt>mod_gzip</tt> exactly if during <em>each</em> of the two decision phases at least one <code>include</code> rule fires but no <code>exclude</code> rule. As such rules allow for regular expressions as parameter values this makes powerful conditions available.</p>
  126 <p>Nevertheless all rules are independent from each other; the directives currently available don't allow the user to express that distinct MIME types only be delivered in compressed form to distinct browsers - the <code>AND</code> connection between several rules is missing.</p>
  127 <p>There seem to be only rare occasions where this would be really helpful - as of now, it would be especially required to fine-tune filter rules as to cope with all the bugs of Netscape 4, other than by totally excluding this browser from compression. With time passing <small>(and improved standards compliancy of the browsers)</small> this feature may become obsolete.</p>
  129 <div id="icon">
  130  <a href="http://validator.w3.org/check/referer"><img alt="" title="valid XHTML 1.1" height="31" width="88" src="valid-xhtml11.png" /></a><a href="http://jigsaw.w3.org/css-validator/check/referer"><img alt="" title="valid CSS" height="31" width="88" src="valid-css.png" /></a>
  131 </div>
  134 <p id="mail">(<a href="mailto:michael.schroepl&#x40;gmx.de?subject=mod_gzip">Michael Schr&ouml;pl</a>, 2002-09-28)</p>
  136 </div>
  138 </body>
  139 </html>