1 Star 0 Fork 0

無神無佛無兲使/akaunting

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
serviceworker.js 1.44 KB
一键复制 编辑 原始数据 按行查看 历史
TheCOBAN 提交于 2020-02-19 20:18 . change pwa image and manifest.json
var staticCacheName = "pwa-v" + new Date().getTime();
var filesToCache = [
'public/img/icons/akaunting-72x72.png',
'public/img/icons/akaunting-96x96.png',
'public/img/icons/akaunting-128x128.png',
'public/img/icons/akaunting-144x144.png',
'public/img/icons/akaunting-152x152.png',
'public/img/icons/akaunting-192x192.png',
'public/img/icons/akaunting-384x384.png',
'public/img/icons/akaunting-512x512.png'
];
/*
// Cache on install
self.addEventListener("install", event => {
this.skipWaiting();
event.waitUntil(
caches.open(staticCacheName)
.then(cache => {
return cache.addAll(filesToCache);
})
)
});
*/
/*
// Clear cache on activate
self.addEventListener('activate', event => {
event.waitUntil(
caches.keys().then(cacheNames => {
return Promise.all(
cacheNames
.filter(cacheName => (cacheName.startsWith("pwa-")))
.filter(cacheName => (cacheName !== staticCacheName))
.map(cacheName => caches.delete(cacheName))
);
})
);
});*/
// Serve from Cache
self.addEventListener("fetch", event => {
event.respondWith(
caches.match(event.request)
.then(response => {
return response || fetch(event.request);
})
.catch(() => {
return caches.match('offline');
})
)
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/markgood/akaunting.git
git@gitee.com:markgood/akaunting.git
markgood
akaunting
akaunting
master

搜索帮助