File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
source/_extensions/pwa_service_files Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,23 @@ self.addEventListener('install', function(e) {
6
6
e . waitUntil (
7
7
caches . open ( 'frc-docs' ) . then ( function ( cache ) {
8
8
fetch ( '_static/cache.json' )
9
- . then ( response => response . json ( ) . then ( data => {
10
- /*for (const i of data) {
11
- cache.addAll()
12
- }*/
13
- cache . addAll ( data ) . catch ( error => {
9
+ . then ( response => response . json ( ) )
10
+ . then ( async ( data ) => {
11
+ for ( let i = 0 ; i < data . length / 10 ; i ++ ) {
12
+ const tofetch = data . slice ( i * 10 , i * 10 + 9 )
13
+ await cache . addAll ( tofetch )
14
+ }
15
+ /*
16
+ for (const i of data) {
17
+ cache.add(i).catch(error => {
18
+ console.error(i, error)
19
+ })
20
+ }
21
+ (cache.addAll(data).catch(error => {
14
22
console.error(error)
15
- } )
16
- console . log ( cache . keys ( ) ) ;
17
- } ) )
23
+ })*/
24
+ // console.log(cache.keys());
25
+ } )
18
26
. catch ( error => {
19
27
console . error ( error ) ;
20
28
} ) ;
You can’t perform that action at this time.
0 commit comments