We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0915483 commit ca2c0e1Copy full SHA for ca2c0e1
src/theme/sw.js
@@ -2,6 +2,11 @@ importScripts(
2
"https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"
3
);
4
5
+self.addEventListener("install", event => {
6
+ // Take over old service worker immediately, should hopefully fix weird caching issues
7
+ self.skipWaiting();
8
+});
9
+
10
// https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#stale-while-revalidate
11
// TLDR: If there's a cached version available, use it, but fetch an update for next time.
12
const staleWhileRevalidate = new workbox.strategies.StaleWhileRevalidate();
0 commit comments