X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=app.psgi;h=837dd60ab51e100408d84934eb6d7fd80a4a724c;hb=4bf1c3e5f36dcf283517de28b92c4ae7ed10edf0;hp=6a1125a4f283b3d7d976f561c11a0707c12dc295;hpb=0f623f3d41b33606db73af07c12161320ed4aa93;p=plack-app-gruntmaster.git diff --git a/app.psgi b/app.psgi index 6a1125a..837dd60 100644 --- a/app.psgi +++ b/app.psgi @@ -41,7 +41,7 @@ sub add_headers { my $resp = $app->($_[0]); my $hdrs = Plack::Util::headers($resp->[1]); $hdrs->set('Content-Security-Policy', CONTENT_SECURITY_POLICY); - $hdrs->set('Link', '; rel=stylesheet') if $hdrs->get('Content-Type') =~ m,^text/html,; + $hdrs->set('Cache-Control', 'public, max-age=604800') if $_[0]->{PATH_INFO} =~ qr,^/static/,; $resp->[1] = $hdrs->headers; $resp; } @@ -54,6 +54,7 @@ builder { enable_if { $_[0]->{PATH_INFO} eq '/ok' } sub { sub{ [200, [], []] }}; enable 'ContentLength'; enable \&add_headers; + enable 'Static', path => qr,^/static/,; enable 'Log4perl', category => 'plack'; enable \&add_database; enable '+Plack::App::Gruntmaster::Auth',