From 8430b8c284b3ab0c84ee41b3013a91289e13b254 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Wed, 29 Jun 2016 13:53:45 +0100 Subject: =?UTF-8?q?Don=E2=80=99t=20cache=20geocoder=20results=20when=20STA?= =?UTF-8?q?GING=5FSITE=20is=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- perllib/FixMyStreet/Geocode.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'perllib/FixMyStreet/Geocode.pm') diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm index 4470ecbca..257a8d4a3 100644 --- a/perllib/FixMyStreet/Geocode.pm +++ b/perllib/FixMyStreet/Geocode.pm @@ -72,7 +72,7 @@ sub cache { my $cache_dir = FixMyStreet->config('GEO_CACHE') . $type . '/'; my $cache_file = $cache_dir . md5_hex($url); my $js; - if (-s $cache_file && -M $cache_file <= 7) { + if (-s $cache_file && -M $cache_file <= 7 && !FixMyStreet->config('STAGING_SITE')) { $js = File::Slurp::read_file($cache_file); } else { $url .= '&' . $args if $args; @@ -80,7 +80,7 @@ sub cache { $js = LWP::Simple::get($url); $js = encode_utf8($js) if utf8::is_utf8($js); File::Path::mkpath($cache_dir); - if ($js && (!$re || $js !~ $re)) { + if ($js && (!$re || $js !~ $re) && !FixMyStreet->config('STAGING_SITE')) { File::Slurp::write_file($cache_file, $js); } } -- cgit v1.2.3