PageSourceSearch

https://julientopcu.com/sw.js

js julientopcu.com collected 2026-10-05 06:50:24 UTC 3,443 bytes, 105 lines download raw bytes

1/**
2 * Welcome to your Workbox-powered service worker!
3 *
4 * You'll need to register this file in your web app and you should
5 * disable HTTP caching for this file too.
6 * See https://goo.gl/nhQhGp
7 *
8 * The rest of the code is auto-generated. Please don't update this file
9 * directly; instead, make changes to your Workbox build configuration
10 * and re-run your build process.
11 * See https://goo.gl/2aRDsh
12 */
13
14importScripts("workbox-v3.6.3/workbox-sw.js");
15workbox.setConfig({modulePathPrefix: "workbox-v3.6.3"});
16
17workbox.core.setCacheNameDetails({prefix: "gatsby-plugin-offline"});
18
19workbox.skipWaiting();
20workbox.clientsClaim();
21
22/**
23 * The workboxSW.precacheAndRoute() method efficiently caches and responds to
24 * requests for URLs in the manifest.
25 * See https://goo.gl/S9QRab
26 */
27self.__precacheManifest = [
28  {
29    "url": "webpack-runtime-7f67c2fa546aeb0abda8.js"
30  },
31  {
32    "url": "framework-a45383fedbea7a016e3a.js"
33  },
34  {
35    "url": "app-b9618ee5cd7bfa5614af.js"
36  },
37  {
38    "url": "component---node-modules-gatsby-plugin-offline-app-shell-js-015c67d5e04f115003f8.js"
39  },
40  {
41    "url": "offline-plugin-app-shell-fallback/index.html",
42    "revision": "3abba4db0fb7513e75d359f9f6100475"
43  },
44  {
45    "url": "polyfill-64b8298512209ae4416e.js"
46  },
47  {
48    "url": "manifest.webmanifest",
49    "revision": "1d76070a99743c6e6d36c11d4cb2a9be"
50  }
51].concat(self.__precacheManifest || []);
52workbox.precaching.suppressWarnings();
53workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
54
55workbox.routing.registerRoute(/(\.js$|\.css$|static\/)/, workbox.strategies.cacheFirst(), 'GET');
56workbox.routing.registerRoute(/^https?:.*\page-data\/.*\/page-data\.json/, workbox.strategies.networkFirst(), 'GET');
57workbox.routing.registerRoute(/^https?:.*\.(png|jpg|jpeg|webp|svg|gif|tiff|js|woff|woff2|json|css)$/, workbox.strategies.staleWhileRevalidate(), 'GET');
58workbox.routing.registerRoute(/^https?:\/\/fonts\.googleapis\.com\/css/, workbox.strategies.staleWhileRevalidate(), 'GET');
59
60/* global importScripts, workbox, idbKeyval */
61
62importScripts(`idb-keyval-iife.min.js`)
63
64const { NavigationRoute } = workbox.routing
65
66const navigationRoute = new NavigationRoute(async ({ event }) => {
67  let { pathname } = new URL(event.request.url)
68  pathname = pathname.replace(new RegExp(`^`), ``)
69
70  // Check for resources + the app bundle
71  // The latter may not exist if the SW is updating to a new version
72  const resources = await idbKeyval.get(`resources:${pathname}`)
73  if (!resources || !(await caches.match(`/app-b9618ee5cd7bfa5614af.js`))) {
74    return await fetch(event.request)
75  }
76
77  for (const resource of resources) {
78    // As soon as we detect a failed resource, fetch the entire page from
79    // network - that way we won't risk being in an inconsistent state with
80    // some parts of the page failing.
81    if (!(await caches.match(resource))) {
82      return await fetch(event.request)
83    }
84  }
85
86  const offlineShell = `/offline-plugin-app-shell-fallback/index.html`
87  return await caches.match(offlineShell)
88})
89
90workbox.routing.registerRoute(navigationRoute)
91
92const messageApi = {
93  setPathResources(event, { path, resources }) {
94    event.waitUntil(idbKeyval.set(`resources:${path}`, resources))
95  },
96
97  clearPathResources(event) {
98    event.waitUntil(idbKeyval.clear())
99  },
100}
101
102self.addEventListener(`message`, event => {
103  const { gatsbyApi } = event.data
104  if (gatsbyApi) messageApi[gatsbyApi](event, event.data)
105})

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.