aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Geocode.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/Geocode.pm')
-rw-r--r--perllib/FixMyStreet/Geocode.pm4
1 files changed, 2 insertions, 2 deletions
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);
}
}