From ebd4c6d82711cbdfd96e72fc2c40c92be9fd200b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 3 Dec 2011 10:43:14 +0100 Subject: less caching for some stops --- cgi/index.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cgi/index.pl b/cgi/index.pl index 7da21ac..73bf1e3 100644 --- a/cgi/index.pl +++ b/cgi/index.pl @@ -20,9 +20,15 @@ sub default_no_lines { sub get_results { my ( $backend, $city, $stop ) = @_; + my $expiry = 900; + + if (lc($city) eq 'berlin' or lc($stop) ~~ [qw[hbf hauptbahnhof]]) { + $expiry = 600; + } + my $cache = Cache::File->new( cache_root => '/tmp/vrr-fake', - default_expires => '900 sec', + default_expires => "${expiry} sec", ); my $sstr = ( $backend eq 'db' ? "${stop}, ${city}" : "${city} _ ${stop}" ); -- cgit v1.2.3