From: Marius Gavrilescu Date: Fri, 7 Feb 2014 15:56:39 +0000 (+0200) Subject: Add Cache-Control to static files X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=7e3d8247f03853c8fd28a48dcd4681a02df32cdd;p=gruntmaster-page.git Add Cache-Control to static files --- diff --git a/app.psgi b/app.psgi index 20092c9..5bed878 100644 --- a/app.psgi +++ b/app.psgi @@ -55,7 +55,8 @@ sub authenticate { builder { enable 'ContentLength'; - enable 'Static', path => qr,/static/,; + enable_if { $_[0]->{PATH_INFO} =~ qr,^/static/,} Header => set => ['Cache-Control', 'public, max-age=604800']; + enable 'Static', path => qr,^/static/,; enable 'Log4perl', category => 'plack', conf => 'log.conf'; enable \&require_admin; enable_if \&some_auth_required, 'Auth::Basic', authenticator => \&authenticate, realm => 'Gruntmaster 6000';