NAME

Mojolicious::Plugin::Gzip - Plugin to Gzip Mojolicious responses

STATUS

SYNOPSIS

  # Mojolicious::Lite
  plugin 'Gzip';

  # With minimum size in bytes required before gzipping. Default is 860.
  plugin Gzip => {min_size => 1500};

  # Mojolicious
  $app->plugin('Gzip');

  # With minimum size in bytes required before gzipping. Default is 860.
  $app->plugin(Gzip => {min_size => 1500});

DESCRIPTION

Mojolicious::Plugin::Gzip gzips all responses equal to or greater than a "min_size" by using the "after_dispatch" in Mojolicious hook. Mojolicious::Plugin::Gzip will only gzip a response if all of these conditions are met:

Mojolicious::Plugin::Gzip will do these things if those conditions are met:

OPTIONS

min_size

  # Mojolicious::Lite
  plugin 'Gzip' => {min_size => 1500};

  # Mojolicious
  $app->plugin(Gzip => {min_size => 1500});

Sets the minimum "body_size" in Mojo::Content required before response content will be gzipped. If the "body_size" in Mojo::Content is greater than or equal to "min_size", then it will be gzipped. Default is 860.

AUTHOR

Adam Hopkins <srchulo@cpan.org>

COPYRIGHT

Copyright 2019- Adam Hopkins

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO