File tree Expand file tree Collapse file tree 4 files changed +8
-1
lines changed
lib/MetaCPAN/Web/Controller Expand file tree Collapse file tree 4 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ sub meta_hack : Local : Args(0) {
4040
4141sub resources : Local : Args(0) {
4242 my ( $self , $c ) = @_ ;
43+ $c -> browser_max_age(' 1y' );
44+ $c -> cdn_max_age(' 1y' );
4345 $c -> res-> redirect( ' /about/contact' , 301 );
4446 $c -> detach;
4547}
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ sub view : Private {
4040 my $release = $c -> stash-> {release };
4141
4242 if ( $data -> {directory } ) {
43+ $c -> cdn_max_age(' 1y' );
4344 $c -> res-> redirect( $c -> uri_for( ' /source' , @path ), 301 );
4445 $c -> detach;
4546 }
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ sub view : Private {
6565
6666 my $release = $data -> {release };
6767
68- $c -> browser_max_age(' 1h ' );
68+ $c -> browser_max_age(' 1d ' );
6969 $c -> res-> last_modified( $release -> {date } );
7070 $c -> cdn_max_age(' 1y' );
7171 $c -> add_dist_key( $release -> {distribution } );
Original file line number Diff line number Diff line change @@ -16,9 +16,13 @@ sub index : Path : Args(0) {
1616 my $page = $req -> page;
1717 my $page_size = $req -> get_page_size(20);
1818
19+ # Cache searches as this is where most traffic hits
20+ $c -> cdn_max_age(' 1d' );
21+
1922 # Redirect back to main page if search query is empty irrespective of
2023 # whether we're feeling lucky or not.
2124 unless ( $req -> param(' q' ) ) {
25+ $c -> browser_max_age(' 1w' );
2226 $c -> res-> redirect(' /' );
2327 $c -> detach;
2428 }
You can’t perform that action at this time.
0 commit comments