Skip to content

Commit

Permalink
cache assets at fastly for a year #1640 - we can purge "assets" to clear
Browse files Browse the repository at this point in the history
  • Loading branch information
ranguard authored and oalders committed Mar 15, 2016
1 parent 43c842c commit 7920291
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/MetaCPAN/Middleware/Static.pm
Expand Up @@ -91,9 +91,9 @@ sub wrap {
mount '/static' => sub {
my $res = $static_app->(@_);
push @{ $res->[1] }, (
'Cache-Control' => "max-age=${hour_ttl}",
'Cache-Control' => "max-age=${day_ttl}",

'Surrogate-Control' => "max-age=${hour_ttl}",
'Surrogate-Control' => "max-age=${year_ttl}",
'Surrogate-Key' => 'assets',
);
$res;
Expand Down
2 changes: 1 addition & 1 deletion t/fastly_headers.t
Expand Up @@ -11,7 +11,7 @@ test_psgi app, sub {
is( $res->code, 200, 'code 200' );
is( $res->header('Set-Cookie'), undef, 'No cookie' );
is( $res->header('Surrogate-Control'),
'max-age=3600', 'Image Surrogate-Control' );
'max-age=31536000', 'Image Surrogate-Control as a year' );
}
};

Expand Down

0 comments on commit 7920291

Please sign in to comment.