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 <js/*.js>;
- [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