Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > d265f71d7fce441fd72dd0a77d0f8893 > files > 245

apache-ssl-1.3.41_1.59-1mdv2010.0.i586.rpm

<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
 <title>Possible enhancements in future versions of mod_gzip</title>
 <meta name="author"      content="Michael Schr&ouml;pl" />
 <meta name="description" content="A list of (hopefully) reasonable and probably easy to implement functional enhancements for further mod_gzip versions" />
 <meta name="keywords"    content="Apache, HTTP, encoding, gzip, compression" />
 <style type="text/css">
body{font-family:sans-serif;margin:0px 30px 0px 30px;}
h1{font-size:22px;margin-top:20px;}
h2{font-size:18px;margin-top:14px;}
small{font-size:80%;}
td{vertical-align:top;}
tt{font-weight:bold;}
code,tt{font-family:"Courier New",monospace;}
h1,h2{margin-bottom:1px;}
p,td{margin-top:3px;margin-bottom:3px;}
p,ul,ol,li{font-size:17px;line-height:22px;}
ul,ol,li{margin-top:0px;margin-bottom:0px;}
img{border-width:0;}

#nav{position:absolute;top:30px;left:0px;font-size:14px;width:170px;font-weight:bold;margin:2px 2px 2px 30px;}
#nav[id]{position:fixed;}
#nav img{margin:5px;}
#nav p, #nav a:hover, #nav a{display:block;padding:3px;margin:2px;width:150px;font-size:15px;line-height:18px;}
#content{position:absolute;left:220px;right:30px;}
#mail{text-align:right;}
#icon{width:190px;float:left;}
#mail,#icon{margin-top:30px;}

@media screen {
body{color:#000;background-color:#f8ebd9;}
h1{color:#666;}
h2{color:#840;}
code{color:#333;}
em{color:#900;}
tt{color:#909;}
h1,h2,code,em,tt{background-color:inherit;}
.new13192a{color:#inherit;background-color:#ffd;}
.new13261a{color:#inherit;background-color:#eff;}
.bugfix{color:#fff;background-color:#f00;font-weight:bold;padding:0px 4px;}
#nav a{color:#530;background-color:transparent;}
#nav a{text-decoration:none;}
#nav p, #nav a:hover{color:#000;background-color:#fff;}
#nav p {border:1px #660 solid;}
#nav a {border:1px #666 dotted;}
}

@media print {
#icon,#nav{display:none;}
#content{position:absolute;left:0px;right:0px;}
}
 </style>
</head>

<body>

<div id="nav">

<img src="mod_gzip_logo.gif" height="47" width="102" alt="mod_gzip logo" />


<a title="mod_gzip - what's that, anyway?" href="index.htm">mod_gzip</a>



<a title="Compression of HTTP content using Content-Encoding" href="encoding.htm">Content-Encoding</a>



<a title="Which browsers can handle 'Content-Encoding: gzip'?" href="browser.htm">Browsers</a>



<a title="How do Firewalls handle 'Content-Encoding:'?" href="firewalls.htm">Firewalls</a>



<a title="An example configuration for mod_gzip" href="config.htm">Configuration</a>



<a title="Complete description of mod_gzip status codes" href="status.htm">Status Codes</a>



<p>Enhancements</p>



<a title="Caching of negotiated HTTP responses" href="cache.htm">Caching</a>



<a title="Version history and change log for mod_gzip" href="versions.htm">Versions</a>



<a title="Other ressources about mod_gzip" href="links.htm">Links</a>


</div>

<div id="content">

<h1>Possible enhancements in future versions of <tt>mod_gzip</tt></h1>

<p>This document describes some possible functional enhancements which hopefully could be implemented into the current version 1.3.26.1a of <tt>mod_gzip</tt> without too much effort and enhance the usability of this module.</p>

<h2><a id="rule_logging"></a>Logging class and value of the decisive filter rule</h2>
<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>
<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>
<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>
<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>

<h2><a id="gzip_level"></a>Configurable gzip compression level</h2>
<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>
<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>
<p>Thus it would be reasonable to have this compression level configurable by offering another directive <code>mod_gzip_compression_level</code>.</p>

<h2><a id="boolean_rules"></a>Boolean expressions in <code>include</code>/<code>exclude</code> directives</h2>
<p><tt>mod_gzip</tt> 1.3.19.1a 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>
<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>
<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>
<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>

<div id="icon">
 <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>
</div>


<p id="mail">(<a href="mailto:michael.schroepl&#x40;gmx.de?subject=mod_gzip">Michael Schr&ouml;pl</a>, 2002-09-28)</p>

</div>

</body>
</html>