X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FJS.pm;h=f51000e85693665d81d3bcea6f5586fc1183c28e;hb=a122bb9b5954e4384b8f1c3f52bcdda74b421f25;hp=fa00293e52e622861206d31edeb87414e7253287;hpb=a94f84535623ae0de44b63290aa4c8b1bf3e5eaa;p=gruntmaster-page.git diff --git a/lib/Gruntmaster/Page/JS.pm b/lib/Gruntmaster/Page/JS.pm index fa00293..f51000e 100644 --- a/lib/Gruntmaster/Page/JS.pm +++ b/lib/Gruntmaster/Page/JS.pm @@ -1,23 +1,14 @@ package Gruntmaster::Page::JS; -use 5.014000; -use strict; -use warnings; use Gruntmaster::Page::Base; -our @ISA = qw/Gruntmaster::Page::Base/; -our $VERSION = '0.001'; - -use File::Slurp qw/read_file/; use JavaScript::Minifier::XS qw/minify/; sub generate{ - my ($self, $format, $logger) = @_; - debug $logger => ""; + my ($self, $format, $env) = @_; + debug $env => ""; my $js; $js .= read_file $_ for ; - [200, ['Content-Type' => 'application/javascript', 'Cache-Control' => 'max-age=604800'], [$js] ] + [200, ['Content-Type' => 'application/javascript', 'Cache-Control' => 'public, max-age=604800', 'X-Forever' => 1], [minify $js] ] } -sub variants{ [[js => 1, 'application/javascript', undef, undef, undef, undef]] } - 1