updated config file environment

This commit is contained in:
Paolo Arena
2019-05-01 11:53:12 +02:00
parent 08c0ded31f
commit d924509d4f
6 changed files with 12 additions and 8 deletions

View File

@@ -16,7 +16,7 @@ importScripts('../statics/js/workbox-sw.js');
let port = 3000;
if (self.location.hostname === 'test.freeplanet.app') {
if (self.location.hostname.startsWith('test')) {
port = 3001;
}
// console.log('SW-06 1');
@@ -68,7 +68,7 @@ if (workbox) {
const debug = false;
workbox.setConfig({ debug: debug });
workbox.core.setCacheNameDetails({ prefix: "freeplanet" });
workbox.core.setCacheNameDetails({ prefix: self.location.hostname });
/**
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
@@ -281,7 +281,7 @@ if (workbox) {
// Storage
workbox.routing.registerRoute(
new RegExp(/.*(?:storage\.freeplanet)\.app.*$/),
new RegExp(/.*(?:storage.*$/),
workbox.strategies.staleWhileRevalidate({
cacheName: 'storage',
plugins: [