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 643 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 4 5 6 7 8 9 10 11
      caches.open('footseen').then((cache) => cache.addAll([
        '/active2022/abc/',
        '/active2022/abc/index.html',
        '/active2022/abc/index.js',
        '/active2022/abc/style.css',
        '/active2022/abc/images/fox1.jpg',
        '/active2022/abc/images/fox2.jpg',
        '/active2022/abc/images/fox3.jpg',
        '/active2022/abc/images/fox4.jpg',
libai's avatar
测试
b10e4e1f
 
libai committed 2 years ago
12 13 14
      ])),
    );
  });
libai's avatar
测试
0fee8ed5
 
libai committed 2 years ago
15
  
libai's avatar
测试
b10e4e1f
 
libai committed 2 years ago
16 17 18 19 20 21
  self.addEventListener('fetch', (e) => {
    console.log(e.request.url);
    e.respondWith(
      caches.match(e.request).then((response) => response || fetch(e.request)),
    );
  });