Skip to content

Commit

Permalink
perltidy
Browse files Browse the repository at this point in the history
  • Loading branch information
ranguard committed May 21, 2014
1 parent 46af729 commit aaed55b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app.psgi
Expand Up @@ -116,22 +116,21 @@ if ( !$ENV{PLACK_ENV} || $ENV{PLACK_ENV} ne 'development' ) {

# Handle surrogate (fastly caching)
my $hour_ttl = 60 * 60;
my $day_ttl = $hour_ttl * 24;
my $day_ttl = $hour_ttl * 24;

$app = builder {

# Tell fastly to cache _asset and _asset_less for a day
enable_if { $_[0]->{PATH_INFO} =~ m{^/_asset} } 'Headers',
set => ['Surrogate-Control' => "max-age=${day_ttl}"];
set => [ 'Surrogate-Control' => "max-age=${day_ttl}" ];

# Tell fastly to cache /static/ for an hour
enable_if { $_[0]->{PATH_INFO} =~ m{^/static} } 'Headers',
set => ['Surrogate-Control' => "max-age=${hour_ttl}"];
set => [ 'Surrogate-Control' => "max-age=${hour_ttl}" ];

$app;
};


Plack::Middleware::ReverseProxy->wrap(
sub {
my $env = shift;
Expand Down

0 comments on commit aaed55b

Please sign in to comment.