X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FCSS.pm;h=2553ab6e5c0833f9371850f83a39d59031b5f65c;hb=3a70241ac427b9b568629f1068c95538e36ffd2e;hp=0f4bf6a8193c88b2ee55f96d17285687670e0eaf;hpb=eac599be8b36a2a10e34942b3cdcaeac269cf4ef;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/CSS.pm b/lib/Gruntmaster/Page/CSS.pm index 0f4bf6a..2553ab6 100644 --- a/lib/Gruntmaster/Page/CSS.pm +++ b/lib/Gruntmaster/Page/CSS.pm @@ -11,11 +11,12 @@ use File::Slurp qw/read_file/; use CSS::Minifier::XS qw/minify/; sub generate{ - my ($self, $format, $logger, $theme) = @_; - debug $logger => "theme is $theme"; + my ($self, $format, $env, $theme) = @_; + debug $env => "theme is $theme"; + return [404, ['Content-Type' => 'text/plain'], [ 'Not found' ]] unless -e "css/themes/$theme.css"; my $css = read_file "css/themes/$theme.css"; $css .= read_file $_ for ; - [200, ['Content-Type' => 'text/css', 'Cache-Control' => 'public, max-age=604800'], [minify $css] ] + [200, ['Content-Type' => 'text/css', 'Cache-Control' => 'public, max-age=604800', 'X-Forever' => 1], [minify $css] ] } sub variants{ [[css => 1, 'text/css', undef, undef, undef, undef]] }