initial commit
This commit is contained in:
8
public/service-worker.js
Normal file
8
public/service-worker.js
Normal file
@@ -0,0 +1,8 @@
|
||||
const CACHE = 'meal-ai-cache-v1'
|
||||
self.addEventListener('install', evt => {
|
||||
self.skipWaiting()
|
||||
evt.waitUntil(caches.open(CACHE).then(cache => cache.addAll(['/', '/index.html', '/src/main.jsx'])))
|
||||
})
|
||||
self.addEventListener('fetch', evt => {
|
||||
evt.respondWith(caches.match(evt.request).then(res => res || fetch(evt.request)))
|
||||
})
|
||||
Reference in New Issue
Block a user