Set Expires headers for Hydra's binary cache
This allows caching by reverse proxies.
This commit is contained in:
@ -5,6 +5,7 @@ use base qw/Catalyst::View/;
|
||||
use File::Basename;
|
||||
use Nix::Store;
|
||||
use Nix::Crypto;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
|
||||
sub process {
|
||||
my ($self, $c) = @_;
|
||||
@ -39,6 +40,8 @@ sub process {
|
||||
$info .= "Signature: 1;$keyName;$sig\n";
|
||||
}
|
||||
|
||||
setCacheHeaders($c, 24 * 60 * 60);
|
||||
|
||||
$c->response->body($info);
|
||||
|
||||
return 1;
|
||||
|
@ -2,6 +2,7 @@ package Hydra::View::NixNAR;
|
||||
|
||||
use strict;
|
||||
use base qw/Catalyst::View/;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
|
||||
sub process {
|
||||
my ($self, $c) = @_;
|
||||
@ -14,6 +15,8 @@ sub process {
|
||||
|
||||
open $fh, "nix-store --dump '$storePath' | bzip2 |";
|
||||
|
||||
setCacheHeaders($c, 365 * 24 * 60 * 60);
|
||||
|
||||
$c->response->body($fh);
|
||||
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user