| const cacheName = 'chatbot-cache-v1'; |
| const assetsToCache = [ |
| '/', |
| '/index.html', |
| '/styles.css', |
| '/script.js', |
| '/icon_vera.png', |
| '/icon_vera2.png', |
| '/manifest.json', |
| '/login.html', |
| '/login.png', |
| '/mic.png', |
| '/newchat.png', |
| '/register.html' |
| '/styles1.css' |
| ]; |
|
|
| self.addEventListener('install', event => { |
| event.waitUntil( |
| caches.open(cacheName).then(cache => { |
| return cache.addAll(assetsToCache); |
| }) |
| ); |
| }); |
|
|
| self.addEventListener('fetch', event => { |
| event.respondWith( |
| caches.match(event.request).then(response => { |
| return response || fetch(event.request); |
| }) |
| ); |
| }); |
|
|