X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FPlack%2FApp%2FGruntmaster.pm;h=131b7542bcf99f7ded495590527392bcdf6dff5f;hb=fdbf59e5def9cbb4e1c0749f819ba8d946c37725;hp=1fc3a85742b6a9c8a6f22a513bf819d0892186f6;hpb=8d29b3b10314c58d01fe2ce7e69865d04525406d;p=gruntmaster-page.git diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index 1fc3a85..131b754 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -10,6 +10,9 @@ our $VERSION = '5999.000_001'; use File::Slurp qw/read_file/; use HTTP::Negotiate qw/choose/; use Plack::Request; +use Gruntmaster::Page::Log; +use Gruntmaster::Page::Pb::Entry; +use Gruntmaster::Page::Generic; my %handlers; @@ -35,7 +38,7 @@ sub call { my $content = read_file "a/$article.$lang"; my $title = read_file "a/$article.$lang.title"; my $html = Gruntmaster::Page::Base::header($lang, $title) . $content . Gruntmaster::Page::Base::footer($lang); - return [200, ['Content-Type' => 'text/html', 'Content-Language' => $lang, 'Vary' => 'Accept-Language'], [$html] ] + return [200, ['Content-Type' => 'text/html', 'Content-Language' => $lang, 'Vary' => 'Accept-Language', 'X-Forever' => 1, 'Cache-Control' => 'max-age=300'], [$html] ] } } @@ -58,11 +61,11 @@ BEGIN{ my $word = qr,(\w+),a; my $ct = qr,(?:\/ct/$word)?,a; - get qr,/css/$word, => 'CSS'; - get qr,/js, => 'JS'; + get qr,/css/$word\.css, => 'CSS'; + get qr,/js\.js, => 'JS'; get qr,/ct/, => 'Ct'; - get qr,/ct/$word, => 'Ct::Entry'; + get qr,/ct/$word/, => 'Ct::Entry'; get qr,/us/, => 'Us'; get qr,/us/$word, => 'Us::Entry';