Skip to content

Commit 6b51bee

Browse files
committed
Add cache control to HomePage
1 parent 01661ba commit 6b51bee

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/grepcpan.pm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ sub tt ( $template, $params = undef ) {
157157
}
158158

159159
sub home {
160+
161+
# for browsers
162+
header( 'Cache-Control' => 'max-age=3600' );
163+
164+
# for CDN, reverse proxies & co
165+
header(
166+
'Surrogate-Control' => 'max-age=3600, stale-while-revalidate=60' );
167+
header( 'Surrogate-Key' => 'homepage' );
168+
160169
template(
161170
'index' => {
162171
'title' => 'grepcpan',

0 commit comments

Comments
 (0)