- CODE REPOSITORY AND BUGTRACKER
- PREVIOUS MAINTAINERS
- COPYRIGHT AND LICENSE
MojoX::Encode::Gzip - Gzip a Mojo::Message::Response
use MojoX:Encode::Gzip; # Simple MojoX::Encode::Gzip->new->maybe_gzip($tx); # With options my $gzip = MojoX::Encode::Gzip->new( min_bytes => 600, max_bytes => 600000, ); $success = $gzip->maybe_gzip($tx);
Gzip compress a Mojo::Message::Response if client supports it.
The minumum number of bytes in the body before we would try to gzip it. Trying to gzip really small messages can take extra CPU power on the server and client without saving any times. Defaults to 500.
The maximum number of bytes in the body before we give up on trying gzip it. Gzipping very large messages can delay the response and possibly exhaust system resources. Defaults to 500000.
my $success = $gzip->maybe_gzip($tx);
Given a Mojo::Transaction object, possibly gzips transforms the response by gzipping it. Returns true if we gzip it, and undef otherwise. The behavior is modified by the
You can find documentation for this module with the perldoc command.
The code repository and a bugtracker are available at http://github.com/reneeb/MojoX-Encode-Gzip.
Inspired by Catalyst::Plugin::Compress::Gzip
2008-2015 Mark Stosberg
Renee Baecker <firstname.lastname@example.org>
This software is copyright (c) 2018 by Renee Baecker.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.