|match||Specifies a regex that must match the PATH_INFO to trigger the middleware.|
A callback that is expected to transform the path instead of using the default
behaviour of appending .gz to the file path. PATH_INFO will be aliased to
the $_ variable, so you can do something like this:
This example will prepend /z/ to file paths instead of appending .gz to them.
An array of PSGI environment key names. If you specify any, then the rules
callback will receive a reference to a hash with just these keys, aliased to
the values in the PSGI environment that will be passed to the wrapped app. You
can modify these values to modify the environment it will see. This allows you
do to something like this:
This somewhat peculiar interface is necessary so the middleware can abstract away the details of trying to copy as little data as possible during a request.
If you reuse a particular configuration of Plack::Middleware::Precompressed in many projects, you can avoid repeating the same configuration in each of them by subclassing this middleware and overriding the rewrite and env_keys methods.
The rewrite method will be called just as the rules callback would be.
The env_keys method should return an array reference and will have the same effect on the rewrite method as the configuration option on the rules callback.
Aristotle Pagaltzis <email@example.com>
This software is copyright (c) 2015 by Aristotle Pagaltzis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
|perl v5.20.3||PLACK::MIDDLEWARE::PRECOMPRESSED (3)||2015-01-10|