You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simply cache the giant icons JSON file using the service worker, done!
Dynamically cache when stuff is requested + Manually cache with the cache action
This should probably do the trick though:
constdynamicCacheName='site-dynamic-v1';constassets=[/* All static assets, like styles, HTML pages, etc here */]// activate eventself.addEventListener('activate',evt=>{evt.waitUntil(caches.open(dynamicCacheName).then((cache)=>{cache.addAll(assets);}));evt.waitUntil(caches.keys().then(keys=>{returnPromise.all(keys.filter(key=>key!==dynamicCacheName).map(key=>caches.delete(key)));}));});// fetch eventself.addEventListener('fetch',evt=>{evt.respondWith(caches.match(evt.request).then(cacheRes=>{returncacheRes||fetch(evt.request).then(fetchRes=>{returncaches.open(dynamicCacheName).then(cache=>{cache.put(evt.request.url,fetchRes.clone());returnfetchRes;})});}));});
The text was updated successfully, but these errors were encountered:
Not sure why the service worker isn't registering, on the website, even though VitePWA is supposed to be generating it. I did make a PR (#70) that adds all the assets in the public folder to the service worker
There would be a few ways to do this:
This should probably do the trick though:
The text was updated successfully, but these errors were encountered: