CGI::Application::Plugin::CompressGzip - Add gzip compression to CGI::Application


CGI-Application-Plugin-CompressGzip documentation Contained in the CGI-Application-Plugin-CompressGzip distribution.

Index


Code Index:

NAME

Top

CGI::Application::Plugin::CompressGzip - Add gzip compression to CGI::Application

VERSION

Top

version 1.02

SYNOPSIS

Top

	package My::App;

	use base qw/CGI::Application/;
    use CGI::Application::Plugin::CompressGzip;

	sub some_run_mode {
		my $self = shift;
	    my $query = $self->query;
	}

DESCRIPTION

Top

This plugin automatically enables gzip content encoding in your CGI::Application program where appropriate. This reduces bandwidth, which is good for your server, and for your site's responsiveness. You "use" it once in your base class, and the rest is transparent.

It does its work by overriding cgiapp_get_query, which returns a new CGI::Compress::Gzip object instead of the default CGI object.

EXPORTS

Top

cgiapp_get_query
	Returns a subclassed CGI object.

SEE ALSO

Top

CGI::Application, CGI::Compress::Gzip

AUTHOR

Top

Rhesa Rozendaal <rhesa@cpan.org>

COPYRIGHT AND LICENSE

Top


CGI-Application-Plugin-CompressGzip documentation Contained in the CGI-Application-Plugin-CompressGzip distribution.

package CGI::Application::Plugin::CompressGzip;
our $VERSION = '1.02';


use 5.006;
use strict;
use warnings;

use CGI::Application 3.21;
use CGI::Compress::Gzip 0.19;

use base qw/Exporter/;

our @EXPORT = qw(
    cgiapp_get_query
);

sub cgiapp_get_query {
    return CGI::Compress::Gzip->new();
}

1;

__END__