-
Notifications
You must be signed in to change notification settings - Fork 0
/
flutter_service_worker.js
39 lines (37 loc) · 1.29 KB
/
flutter_service_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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict';
const CACHE_NAME = 'flutter-app-cache';
const RESOURCES = {
"index.html": "bc2e9f65c941bdc1eb9ed7c37eea8de3",
"/": "bc2e9f65c941bdc1eb9ed7c37eea8de3",
"main.dart.js": "2f209e3e1531863a7ba533fe53a1a9c4",
"icons/Icon-192.png": "ac9a721a12bbc803b44f645561ecb1e1",
"icons/Icon-512.png": "96e752610906ba2a93c65f8abe1645f1",
"manifest.json": "6809d0720b22bab18ffc15bc1ad43055",
"assets/LICENSE": "e020bf2e3088eb8e1147b7397c917ebd",
"assets/AssetManifest.json": "2efbb41d7877d10aac9d091f58ccd7b9",
"assets/FontManifest.json": "01700ba55b08a6141f33e168c4a6c22f",
"assets/packages/cupertino_icons/assets/CupertinoIcons.ttf": "115e937bb829a890521f72d2e664b632",
"assets/fonts/MaterialIcons-Regular.ttf": "56d3ffdef7a25659eab6a68a3fbfaf16"
};
self.addEventListener('activate', function (event) {
event.waitUntil(
caches.keys().then(function (cacheName) {
return caches.delete(cacheName);
}).then(function (_) {
return caches.open(CACHE_NAME);
}).then(function (cache) {
return cache.addAll(Object.keys(RESOURCES));
})
);
});
self.addEventListener('fetch', function (event) {
event.respondWith(
caches.match(event.request)
.then(function (response) {
if (response) {
return response;
}
return fetch(event.request);
})
);
});