GZip -- Version 1.6

This compresses output if it matches certain criteria and if your browser
supports gzip'd web pages.  This will save bandwidth, but could use a bit
more processor time.


Features
========

* Less data transferred to client, so faster on low-bandwidth connections.
* Browser detection -- compresses only if the browser allows it
* Uses zlib or gzip (whatever is available -- see below)
* Compresses only when bigger than size specified


Description
===========

This plugin, when used with new hooks that I inserted, will compress all
output to the user, if it is bigger than the limit and if the user so
desires.  The advantage is that bandwidth is saved and that people using
modems will be much happier.  The disadvantage is that it does suck a
little bit more CPU time, and that a temporary file needs to be created.

Output will be compressed only if it is bigger than the size specified
by the user.  This will not compress excessively small documents, and thus
save server load.

As it turns out, I use gzcompress() if you have zlib compiled into PHP.
The downfall is that it doesn't produce the gzip header nor the proper
gzip CRC, both of which I have corrected in the code.  This might get
changed post-4.0.2.

If you have zlib compiled into PHP, this plugin takes advantage of the
library and will not spawn separate gzip processes.  If PHP is not
compiled with zlib, don't worry.  This plugin will use your gzip binary,
if you have gzip installed, but you might need to specify it in
setup.php near the top.  If you are using a strange gzip, make sure
that it can have information sent to it (via STDIN) and that the output
(STDOUT) can be redirected to a file.  A good test would be
  echo This Is A Test | gzip > output_file
  
In order for this plugin to work, you need to have two hooks set up on
whatever pages you want compressed.  The first is 'html_top', and the
other is 'html_bottom'.  html_top must be before the HTML output starts,
usually before the DisplayPageHeader() function.  The html_bottom hook
should be placed at the very end of the PHP script.  These new hooks
are temporary, until offical hooks are placed at the very beginning and
end of each script.


Future Work
===========

* Work around the temporary file
* Different compression techniques (deflate, bzip, etc)
* Maybe use a different directory for temporary files than $data_dir


Installation
============

As with other plugins, just uncompress the archive in the plugins
directory, go back to the main directory, run configure and add the plugin.

Questions/comments/flames/etc can be sent to the SquirrelMail Plugins list.


Changes
=======
1.6 - Removed some minor bugs
    
1.5 - Removed an error message

1.4 - Now properly removes the extra '; q=1.0' stuff from encoding lines
      from the browser
    
1.3 - No longer leaves stray temporary files in the data directory if you use
      zlib
    
1.2 - If you have zlib installed, it no longer requires temporary files
  
1.1 - Fixed documentation to say GZip
    - Enforced minimum size requirement when compressing
