summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Quantum.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-06-21 22:15:06 +0200
committerDylan William Hardison <dylan@hardison.net>2018-06-28 22:42:00 +0200
commit142b1c3262d7c4a61fa7a80254a6a82506d74d23 (patch)
treeb1833f0675902e893987f7c1e9570ff8d274a967 /Bugzilla/Quantum.pm
parentee7ec91ac4306f255005f814250d97204afc0351 (diff)
downloadbugzilla-142b1c3262d7c4a61fa7a80254a6a82506d74d23.tar.gz
bugzilla-142b1c3262d7c4a61fa7a80254a6a82506d74d23.tar.xz
cache headers for static assets
Diffstat (limited to 'Bugzilla/Quantum.pm')
-rw-r--r--Bugzilla/Quantum.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/Bugzilla/Quantum.pm b/Bugzilla/Quantum.pm
index e1cf94f2c..2519e23ad 100644
--- a/Bugzilla/Quantum.pm
+++ b/Bugzilla/Quantum.pm
@@ -34,6 +34,15 @@ sub startup {
$self->plugin('Bugzilla::Quantum::Plugin::Hostage');
$self->plugin('Bugzilla::Quantum::Plugin::BlockIP');
+ if ( $self->mode ne 'development' ) {
+ $self->hook(
+ after_static => sub {
+ my ($c) = @_;
+ $c->res->headers->cache_control('public, max-age=31536000');
+ }
+ );
+ }
+
my $r = $self->routes;
Bugzilla::Quantum::CGI->load_all($r);
Bugzilla::Quantum::CGI->load_one('bzapi_cgi', 'extensions/BzAPI/bin/rest.cgi');
@@ -47,9 +56,10 @@ sub startup {
$r->get(
'/__lbheartbeat__' => sub {
my $c = shift;
- $c->reply->file($c->app->home->child('__lbheartbeat__'));
+ $c->reply->file( $c->app->home->child('__lbheartbeat__') );
},
);
+
$r->get('/__heartbeat__')->to( 'CGI#heartbeat_cgi');
$r->get('/robots.txt')->to( 'CGI#robots_cgi' );