diff --git a/schoolapps/schoolapps/settings.py b/schoolapps/schoolapps/settings.py index 1f752893e786b39a53f0f398f394c08274f41f92..2af92f61ea3d6b17b62d841f25ddac4da0e5082b 100755 --- a/schoolapps/schoolapps/settings.py +++ b/schoolapps/schoolapps/settings.py @@ -21,7 +21,7 @@ ALLOWED_HOSTS = [ '159.69.181.50', 'localhost', '127.0.0.1', - '27c46adf.ngrok.io' + 'bd799848.ngrok.io' ] INTERNAL_IPS = [ diff --git a/schoolapps/static/common/serviceworker.js b/schoolapps/static/common/serviceworker.js index 5ed6917a312968674a471a4b84366335d2d14498..7a37e4d918fc682c629318e63ec914d2662d187a 100644 --- a/schoolapps/static/common/serviceworker.js +++ b/schoolapps/static/common/serviceworker.js @@ -3,21 +3,21 @@ const CACHE = "schoolapps-cache"; const precacheFiles = [ - '', - '/faq' + '/', + '/faq/' ]; -const offlineFallbackPage = '/offline'; +const offlineFallbackPage = '/offline/'; const networkFirstPaths = [ ]; const avoidCachingPaths = [ - '/admin', - '/settings', - '/support/feedback', - '/support/rebus', - '/faq/ask' + '/admin/', + '/settings/', + '/support/feedback/', + '/support/rebus/', + '/faq/ask/' ]; function pathComparer(requestUrl, pathRegEx) { @@ -75,7 +75,7 @@ function cacheFirstFetch(event) { event.respondWith( fromCache(event.request).then( function (response) { - // The response was found in the cache so we responde with it and update the entry + // The response was found in the cache so we respond with it and update the entry // This is where we call the server to get the newest version of the // file to use the next time we show view @@ -104,9 +104,7 @@ function cacheFirstFetch(event) { console.log("[SchoolApps PWA] Network request failed and no cache." + error); // Use the precached offline page as fallback - return caches.open(CACHE).then(function (cache) { - cache.match(offlineFallbackPage); - }); + return caches.match(offlineFallbackPage) }); } )