I am working on a PWA (with very basic vanilla JS) and i try to make a unity webGL launch in it even when the user is offline. I have put all of my files on cache but it still does not work. I'm a begginer in this so i'll be very thankfull for any help on this. Here is the content of my service-worker file :
const cacheName = "static"
const appFiles = [
"./",
"xmlhttprequest-length-computable.min.js?v=1.5.1.22060315",
"images/favicon.ico",
"images/icon.png",
"style.css",
"responsiveMinimalTemplateStyles.css",
"responsiveMinimalTemplateLoader.js",
"manifest.json",
"Build/WebGL.loader.js",
"Build/WebGL.framework.js",
"Build/WebGL.data",
"Build/WebGL.wasm"
]
self.addEventListener("install", e => {
console.log('Install')
e.waitUntil(
caches.open(cacheName).then(cache => {
return cache.addAll(appFiles)
})
)
})
self.addEventListener("fetch", e => {
e.respondWith(
caches.match(e.request).then(response => {
return response || fetch(e.request)
})
)
})
Any ideas ?