NAME
Apache::GzipChain - compress HTML (or anything) in the OutputChain
SYNOPSIS
In the configuration of your apache add something like
SetHandler perl-script
PerlHandler Apache::OutputChain Apache::GzipChain __your_handler__
PerlSetVar GzipForce on # optional
DESCRIPTION
This module compresses any output from another perl handler if the
browser requesting the document understands gzip encoding or if the
config variable ForceGzip is set. To determine if the browser is able to
understand us we check its *Accept-Encoding* header.
The module works without influencing the other handlers in the chain.
The only thing that can be noticed by other handlers is that the
response header 'Content-Encoding' has been set. If GzipChain decides
not to do any compression, it just declines and doesn't even register
itself for the output chain.
GzipChain compresses every single buffer content it receives via the
output chain separately according to the GZIP specification (RFC 1952).
The compression ratio therefore suffers if the other module sends its
data in very small chunks. It is recommended that you use as few print
statements as possible in conjunction with the GzipChain. One single
print statement is recommended.
HEADERS
This handler sets the header "Content-Encoding" to "gzip" whenever it
sends gzipped data.
It also sets or appends to the "Vary" header the values
"Accept-Encoding" unless the config variable GzipForce is set, in which
case the output is the same for all user agents.
Unicode
Using this module under perl-5.8 or higher is ok for Unicode data. UTF-8
data passed to Compress::Zlib::memGzip() are converted to raw UTF-8
before compression takes place. Other data are simply passed through.
PREREQUISITES
Compress::Zlib, Apache::OutputChain
AUTHOR
Andreas Koenig, koenig@kulturbox.de based on code by Jan Pazdziora,
adelton@fi.muni.cz
LICENSE
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.