1importScripts('https://cdn.jsdelivr.net/npm/[email protected]/workbox/workbox-sw.js') 2 3workbox.setConfig({ 4 "debug": false 5}); 6// Start controlling any existing clients as soon as it activates 7workbox.core.clientsClaim() 8 9// Skip over the SW waiting lifecycle stage 10workbox.core.skipWaiting() 11 12workbox.precaching.cleanupOutdatedCaches() 13 14 15 workbox.routing.registerRoute( 16 new RegExp('https://jororwxhmimolm5m\.ldycdn\.com/.*(?:png|gif|jpg|jpeg|webp|svg)$'), 17 new workbox.strategies.CacheFirst({ 18 cacheName: 'cdn:images', 19 plugins: [ 20 new workbox.cacheableResponse.Plugin({ 21 statuses: [0, 200] 22 }), 23 new workbox.expiration.Plugin({ 24 maxEntries: 30, 25 maxAgeSeconds: 30 * 24 * 60 * 60, // 30 Days 26 }), 27 ], 28 }) 29 ); 30 workbox.routing.registerRoute( 31 new RegExp('https://jororwxhmimolm5m\.ldycdn\.com/.*(?:js|css)$'), 32 new workbox.strategies.StaleWhileRevalidate({ 33 cacheName: 'cdn:cssjs', 34 plugins: [ 35 new workbox.cacheableResponse.Plugin({ 36 statuses: [0, 200] 37 }), 38 new workbox.expiration.Plugin({ 39 maxEntries: 30, 40 maxAgeSeconds: 7 * 24 * 60 * 60, // 7 Days 41 }) 42 ] 43 }) 44 ); 45 46 47 workbox.routing.registerRoute( 48 new RegExp('https://inrorwxhmimolm5m\.ldycdn\.com/.*(?:png|gif|jpg|jpeg|webp|svg)$'), 49 new workbox.strategies.CacheFirst({ 50 cacheName: 'cdn:images', 51 plugins: [ 52 new workbox.cacheableResponse.Plugin({ 53 statuses: [0, 200] 54 }), 55 new workbox.expiration.Plugin({ 56 maxEntries: 30, 57 maxAgeSeconds: 30 * 24 * 60 * 60, // 30 Days 58 }), 59 ], 60 }) 61 ); 62 workbox.routing.registerRoute( 63 new RegExp('https://inrorwxhmimolm5m\.ldycdn\.com/.*(?:js|css)$'), 64 new workbox.strategies.StaleWhileRevalidate({ 65 cacheName: 'cdn:cssjs', 66 plugins: [ 67 new workbox.cacheableResponse.Plugin({ 68 statuses: [0, 200] 69 }), 70 new workbox.expiration.Plugin({ 71 maxEntries: 30, 72 maxAgeSeconds: 7 * 24 * 60 * 60, // 7 Days 73 }) 74 ] 75 }) 76 ); 77 78 79 workbox.routing.registerRoute( 80 new RegExp('https://rlrorwxhmimolm5m\.ldycdn\.com/.*(?:png|gif|jpg|jpeg|webp|svg)$'), 81 new workbox.strategies.CacheFirst({ 82 cacheName: 'cdn:images', 83 plugins: [ 84 new workbox.cacheableResponse.Plugin({ 85 statuses: [0, 200] 86 }), 87 new workbox.expiration.Plugin({ 88 maxEntries: 30, 89 maxAgeSeconds: 30 * 24 * 60 * 60, // 30 Days 90 }), 91 ], 92 }) 93 ); 94 workbox.routing.registerRoute( 95 new RegExp('https://rlrorwxhmimolm5m\.ldycdn\.com/.*(?:js|css)$'), 96 new workbox.strategies.StaleWhileRevalidate({ 97 cacheName: 'cdn:cssjs', 98 plugins: [ 99 new workbox.cacheableResponse.Plugin({ 100 statuses: [0, 200] 101 }), 102 new workbox.expiration.Plugin({ 103 maxEntries: 30, 104 maxAgeSeconds: 7 * 24 * 60 * 60, // 7 Days 105 }) 106 ] 107 }) 108 ); 109 110 111// Cache the Google Fonts stylesheets with a stale-while-revalidate strategy. 112workbox.routing.registerRoute( 113 /^https:\/\/fonts\.googleapis\.com/, 114 new workbox.strategies.StaleWhileRevalidate({ 115 cacheName: 'google-fonts-stylesheets', 116 }) 117); 118 119// Cache the underlying font files with a cache-first strategy for 1 year. 120workbox.routing.registerRoute( 121 /^https:\/\/fonts\.gstatic\.com/, 122 new workbox.strategies.CacheFirst({ 123 cacheName: 'google-fonts-webfonts', 124 plugins: [ 125 new workbox.cacheableResponse.Plugin({ 126 statuses: [0, 200], 127 }), 128 new workbox.expiration.Plugin({ 129 maxAgeSeconds: 60 * 60 * 24 * 365, 130 maxEntries: 30, 131 }), 132 ], 133 }) 134); 135 136 137workbox.routing.registerRoute( 138 /\.html$/, 139 new workbox.strategies.NetworkFirst ({ 140 networkTimeoutSeconds: 5, 141 cacheName:'html-caches', 142 plugins: [ 143 new workbox.cacheableResponse.Plugin({ 144 statuses: [0, 200] 145 }), 146 new workbox.expiration.Plugin({ 147 maxEntries: 30, 148 maxAgeSeconds: 10 * 60 * 60 149 }) 150 ] 151}), 'GET'); 152workbox.routing.registerRoute( 153 /\.(?:png|gif|jpg|jpeg|webp|svg)$/, 154 new workbox.strategies.CacheFirst({ 155 cacheName: 'images', 156 plugins: [ 157 new workbox.cacheableResponse.Plugin({ 158 statuses: [0, 200] 159 }), 160 new workbox.expiration.Plugin({ 161 maxEntries: 30, 162 maxAgeSeconds: 7 * 24 * 60 * 60, // 7 Days 163 }), 164 ], 165 }) 166);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.