Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

libai / footseen-large-website

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • footseen-large-website
  • mTest
  • sw.js
Find file
Normal viewHistoryPermalink
sw.js 410 Bytes
Newer Older
libai's avatar
测试
b10e4e1f
 
libai committed 2 years ago
1 2
self.addEventListener('install', (e) => {
    e.waitUntil(
libai's avatar
测试
0fee8ed5
 
libai committed 2 years ago
3
      caches.open('footseen').then((cache) => cache.addAll([
libai's avatar
测试
9eae2f07
 
libai committed 2 years ago
4 5 6
        '/mTest/',
        '/mTest/index.html',
        '/mTest/index.js',
libai's avatar
测试
b10e4e1f
 
libai committed 2 years ago
7 8 9
      ])),
    );
  });
libai's avatar
测试
0fee8ed5
 
libai committed 2 years ago
10
  
libai's avatar
测试
b10e4e1f
 
libai committed 2 years ago
11
  self.addEventListener('fetch', (e) => {
libai's avatar
测试
b2145d02
 
libai committed 2 years ago
12
    // console.log(e.request.url);
libai's avatar
测试
b10e4e1f
 
libai committed 2 years ago
13 14 15 16
    e.respondWith(
      caches.match(e.request).then((response) => response || fetch(e.request)),
    );
  });