summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-12-03 10:43:14 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-12-03 10:43:14 +0100
commitebd4c6d82711cbdfd96e72fc2c40c92be9fd200b (patch)
treee412ca7de749198b08470731b1cec799aefc2565
parent9015d556eb2a60b3ea0b753605887631e3f722be (diff)
less caching for some stops
-rw-r--r--cgi/index.pl8
1 files changed, 7 insertions, 1 deletions
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}" );