Skip to content

Instantly share code, notes, and snippets.

@ingydotnet
Created February 17, 2011 04:07
Show Gist options
  • Save ingydotnet/830955 to your computer and use it in GitHub Desktop.
Save ingydotnet/830955 to your computer and use it in GitHub Desktop.
enable sub {
my $app = shift;
return sub {
my $env = shift;
my $res = $app->($env);
my $control = $env->{PATH_INFO} =~ /\.(css|js)$/
? 'max-age=42'
: 'no-cache';
Plack::Util::header_set($res->[1], 'Cache-Control', $control);
return $res;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment