diff --git a/public/service-worker.js b/public/service-worker.js index 2d3a8f0f..a0f174cf 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -56,15 +56,19 @@ self.addEventListener('activate', function (event) { // Basic offline mode // Just respond with an offline error page for now self.addEventListener('fetch', function(event) { - event.respondWith( - caches.match(event.request).then(function(response) { - return response || fetch(event.request); - }).catch(function () { - if (event.request.mode == 'navigate') { - return caches.match('/offline.html'); - } - }) - ) + if (event.request.url.indexOf('stage.pony.fm') > -1) { + event.respondWith(fetch(event.request)); + } else { + event.respondWith( + caches.match(event.request).then(function (response) { + return response || fetch(event.request); + }).catch(function () { + if (event.request.mode == 'navigate') { + return caches.match('/offline.html'); + } + }) + ) + } }); self.addEventListener('push', function(event) {