Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const STATIC_DATA = [
'/',
'/index.html',
'/model/museum.glb',
'/babylonjs_js/babylon.js',
'/babylonjs_js/babylonjs.loaders.min.js',
'/babylonjs_js/babylonjs.material.min.js',
'/babylonjs_js/babylon.gui.min.js',
'/babylonjs_js/babylon.inspector.bundle.js',
'/babylonjs_js/pep.js',
'/js/TeleportCheck.js'
];
const cacheName ='cache_v1';
self.addEventListener('install', e => {
console.log('[ServiceWorker] Install');
e.waitUntil(
caches.open(cacheName).then(cache => {
return cache.addAll(STATIC_DATA)
.then(()=> self.skipWaiting());
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment