aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--perllib/FixMyStreet/App/Controller/Offline.pm1
-rw-r--r--t/app/controller/offline.t1
3 files changed, 3 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ac1958e86..e2914f303 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -36,6 +36,7 @@
- Do not strip spaces from middle of Open311 category codes. #3167
- Show all category history even if category renamed.
- Fix email alert on initial update template.
+ - Do not cache the service worker
- Admin improvements:
- Display user name/email for contributed as reports. #2990
- Interface for enabling anonymous reports for certain categories. #2989
diff --git a/perllib/FixMyStreet/App/Controller/Offline.pm b/perllib/FixMyStreet/App/Controller/Offline.pm
index adb3de14d..af05c585f 100644
--- a/perllib/FixMyStreet/App/Controller/Offline.pm
+++ b/perllib/FixMyStreet/App/Controller/Offline.pm
@@ -22,6 +22,7 @@ Offline pages Catalyst Controller - service worker handling
sub service_worker : Path("/service-worker.js") {
my ($self, $c) = @_;
+ $c->res->headers->header('Cache-Control' => 'max-age=0');
$c->res->content_type('application/javascript');
}
diff --git a/t/app/controller/offline.t b/t/app/controller/offline.t
index 876475264..d48af676f 100644
--- a/t/app/controller/offline.t
+++ b/t/app/controller/offline.t
@@ -54,6 +54,7 @@ FixMyStreet::override_config {
subtest 'service worker' => sub {
$mech->get_ok('/service-worker.js');
+ is $mech->res->header('Cache-Control'), 'max-age=0', 'service worker is not cached';
$mech->content_contains('translation_strings');
$mech->content_contains('offline/fallback');
};