CGI-Compress-Gzip
Last update: v0.20, 2005-04-22
CGI::Compress::Gzip extends the CGI infrastructure to compresses output, whenever possible. It uses IO::Zlib (a filehandle wrapper around the C zlib library). If this is missing, the functionality degrades gracefully to the typical CGI behavior. The programmer can selectively enable or disable the compression functionality at will. This module does not rely on any particular server setup. It should work anywhere that CGI.pm works.
Apache mod_perl users may prefer the more straightforward implementation offered by the Apache::Compress or Apache::GzipChain modules, although those offer less control to the programmer.
WARNING: as of v0.15 this module is working on Linux and MacOSX but broken on Windows (debugging help would be greatly appreciated on that platform). I've personally tested that it runs well on the following:
RedHat_7.3 MacOSX_10.2.6 perl 5.6.0 ok (Apple's perl) perl 5.6.1 ok perl 5.8.0 ok mod_perl 5.6.0 ok (Apple's mod_perl and Apache 1.3.27) mod_perl 5.6.1 ok (Apache 1.3.27)
KNOWN ISSUES
* This module fails tests specifically under Windows in ways I do not understand, as reported by CPANPLUS testers. There is some problem with my IO::Zlib tests. If anyone knows about IO::Zlib failures or caveats on Windows, please let me know. It *might* be related to binmode, but I have not tested this theory.
* This module has been observed to fail on Solaris. The error is very strange and may be Compress::Zlib's fault. In a nutshell, Compress::Zlib gets into infinite recursion in its AUTOLOAD function. I don't think it's this module's fault
* Under Apache::Registry, global variables may not go out of scope in time. This may causes timing bugs, since this module makes use of the DESTROY() method. To avoid this issue, make sure your CGI object is stored in a scoped variable.
--- BROKEN CODE --- use CGI::Compress::Gzip; $q = CGI::Compress::Gzip->new; print $q->header; print "Hello, world\n";
--- WORKAROUND CODE --- use CGI::Compress::Gzip; do { my $q = CGI::Compress::Gzip->new; print $q->header; print "Hello, world\n"; }
Perl License
This software is released by Clotho Advanced Media, Inc. under the same terms as Perl itself. That means that it is dual-licensed under the Artistic license and the GPL, and that you can redistribute it and/or modify it under the terms of either or both of those licenses. Copies of this license are available from Clotho or view the LICENSE file directly.
GPL License
Releases of this software are available under the General Public License, v2. Copies of this license are available from Clotho and GNU.
Clotho License
Releases of this software are available under commercial license directly from Clotho. Please contact us at info@clotho.com to purchase a license.