-
Notifications
You must be signed in to change notification settings - Fork 1
/
worker.js
executable file
·24 lines (23 loc) · 968 Bytes
/
worker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Hiding this line as it is related to some type of caching.
// importScripts('/worker-polyfill.js')
self.addEventListener('install', function(event) {
console.log("Dialogflow Service Worker installed.");
// Hiding it as not require Cache for now.
// event.waitUntil(caches.open('dialogflow').then(function(cache) {
// return cache.addAll([
// '/',
// '/index.html',
// 'https://fonts.googleapis.com/icon?family=Material+Icons',
// 'https://unpkg.com/[email protected]/dist/material-components-web.min.css',
// '/dist/build.js'
// ])
// }))
})
self.addEventListener('fetch', function(event) {
console.log("cached", event.request)
// Hiding it to remove caching.
// console.log("cached", event.request.url)
// event.respondWith(caches.match(event.request).then(function(response) {
// return response || fetch(event.request)
// }))
})