Set Expires headers for Hydra's binary cache
This allows caching by reverse proxies.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user