From 7e3d8247f03853c8fd28a48dcd4681a02df32cdd Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 7 Feb 2014 17:56:39 +0200 Subject: [PATCH] Add Cache-Control to static files --- app.psgi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'; -- 2.39.2