package gzip; # Blosxom Plugin: gzip # Author(s): Tatsuhiko Miyagawa # Changes: # 0.01 Mon Aug 18 02:37:53 JST 2003 # first release use strict; sub start { return accept_gzip() && has_compress_zlib(); } sub accept_gzip { my $accept = $ENV{HTTP_ACCEPT_ENCODING}; return $accept && $accept =~ /gzip/; } sub has_compress_zlib { eval { require Compress::Zlib }; return !$@; } sub last { $blosxom::output = Compress::Zlib::memGzip($blosxom::output); $blosxom::header->{'Content-Encoding'} = 'gzip'; } 1; __END__ =head1 NAME Blosxom Plug-in: gzip =head1 SYNOPSIS Purpose: compress blosxom output with gzip encoding. =head1 REQUIREMENT This plugin requires Compress::Zlib perl module =head1 AUTHOR Tatsuhiko Miyagawa , http://shibuya.pm.org/ =head1 BUGS Address bug reports and comments to the Blosxom mailing list [http://www.yahoogroups.com/group/blosxom]. =head1 LICENSE Copyright 2003, Tatsuhiko Miyagawa This program is licensed under the GPL or Perl Artistic License. =cut