Set Expires headers for Hydra's binary cache

This allows caching by reverse proxies.
This commit is contained in:
Eelco Dolstra
2014-11-06 14:31:04 +01:00
parent 55eb55478d
commit c250407f3c
4 changed files with 17 additions and 0 deletions

View File

@ -28,6 +28,7 @@ our @EXPORT = qw(
showJobName
showStatus
getResponsibleAuthors
setCacheHeaders
);
@ -305,4 +306,12 @@ sub getResponsibleAuthors {
}
# Set HTTP headers for the Nix binary cache.
sub setCacheHeaders {
my ($c, $expiration) = @_;
$c->response->headers->expires(time + $expiration);
delete $c->response->cookies->{hydra_session};
}
1;