The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Plack::Middleware::Static::Minifier - serves static files and minify CSS and JavaScript

SYNOPSIS

    use Plack::Builder;
    builder {
        enable "Plack::Middleware::Static::Minifier",
            path => qr{^/(js|css|images)/},
            root => './htdocs/';
        $app;
    };

or you can cache minified content

    use Plack::Builder;
    use Cache::FileCache;

    my $cache = Cache::FileCache->new(+{
        cache_root         => '/tmp/foo',
        namespace          => 'namespace',
        default_expires_in => 60*60*24*7,
    });

    builder {
        enable "Plack::Middleware::Static::Minifier",
            path  => qr{^/(js|css|images)/},
            root  => './htdocs/',
            cache => $cache;
        $app;
    };

Also you can stop minifying by no_minify option

    use Plack::Builder;

    builder {
        enable "Plack::Middleware::Static::Minifier",
            path  => qr{^/(js|css|images)/},
            root  => './htdocs/',
            no_minify => $env_is_dev;
        $app;
    };

DESCRIPTION

Plack::Middleware::Static::Minifier serves static files with Plack and minify CSS and JavaScript. This module is the subclass of Plack::Middleware::Static.

See Plack::Middleware::Static for more detail.

METHOD

call

REPOSITORY

Plack::Middleware::Static::Minifier is hosted on github <http://github.com/bayashi/Plack-Middleware-Static-Minifier>

AUTHOR

Dai Okabayashi <bayashi@cpan.org>

SEE ALSO

Plack::Middleware::Static, CSS::Minifier::XS, JavaScript::Minifier::XS Plack::Middleware, Plack

LICENSE

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