1importScripts('https://g.lazcdn.com/g/lzd/assets/1.1.20/workbox/6.0.2/workbox-sw.js'); 2workbox.setConfig({ 3 debug: false, 4 modulePathPrefix: 'https://g.lazcdn.com/g/lzd/assets/1.1.20/workbox/6.0.2/', 5}); 6 7self.__WB_MANIFEST = [{"url":"https://g.lazcdn.com/g/lzdfe/pdp-modules/2.0.25/pc-mod.css","revision":"2.0.25"},{"url":"https://g.lazcdn.com/g/lzdfe/pdp-modules/2.0.25/pc-mod.js","revision":"2.0.25"},{"url":"https://g.lazcdn.com/g/lzdfe/pdp-platform/0.1.29/pc.js","revision":"0.1.29"},{"url":"https://g.lazcdn.com/g/lzdfe/pdp-platform/0.1.29/pc.css","revision":"0.1.29"}]; 8 9const { core, routing, strategies, cacheableResponse, expiration, precaching } = workbox; 10const { setCacheNameDetails, skipWaiting, clientsClaim } = core; 11const { registerRoute } = routing; 12const { CacheFirst, StaleWhileRevalidate, Strategy } = strategies; 13const { CacheableResponsePlugin } = cacheableResponse; 14const { ExpirationPlugin } = expiration; 15const { precacheAndRoute, matchPrecache } = precaching; 16 17// skipWaiting(); 18clientsClaim(); 19 20core.setCacheNameDetails({ 21 prefix: 'node-pdp', 22 suffix: 'v1', 23 precache: 'precache', 24 runtime: 'runtime', 25 googleAnalytics: 'google' 26}); 27 28precacheAndRoute(self.__WB_MANIFEST); 29 30const matchImgFunction = ({url}) => { 31 if (url.href.includes('disable_sw=1')) { 32 return false; 33 } 34 return /laz-img-.+.alicdn.com/.test(url.host) || url.host.includes('slatic.net'); 35}; 36 37registerRoute( 38 matchImgFunction, 39 new CacheFirst({ 40 cacheName: 'image-cache', 41 plugins: [ 42 new ExpirationPlugin({ 43 maxAgeSeconds: 7 * 24 * 60 * 60, 44 maxEntries: 100, 45 }), 46 new CacheableResponsePlugin({ 47 statuses: [0, 200], 48 }) 49 ] 50 }) 51); 52 53const matchAssetsFunction = ({url}) => { 54 if (url.href.includes('disable_sw=1')) { 55 return false; 56 } 57 return url.host === 'g.lazcdn.com' 58 || url.host === 'laz-g-cdn.alicdn.com' 59 || url.host === 'g.alicdn.com' 60 || url.host === 'assets.alicdn.com'; 61}; 62 63registerRoute( 64 matchAssetsFunction, 65 new CacheFirst({ 66 cacheName: 'assets-cache', 67 plugins: [ 68 new ExpirationPlugin({ 69 maxAgeSeconds: 7 * 24 * 60 * 60, 70 maxEntries: 100, 71 }), 72 new CacheableResponsePlugin({ 73 statuses: [0, 200], 74 }) 75 ] 76 }) 77);
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.