I have a perfectly functioning service worker. The problem is that it is caching the logged-on user. So every time I update the page, even logged in, it shows the header unlogged. My service worker:
importScripts("{% static 'js/cache-polyfill.js' %}");
self.addEventListener('install', function(e) {
e.waitUntil(
caches.open('testv1').then(function(cache) {
return cache.addAll([
"/",
"{% static 'assets/css/all.css' %}",
"{% static 'assets/js/all.js' %}",
]);
})
);
});
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request).then(function(response) {
return response || fetch(event.request);
})
);
});