Skip to content

Commit 96a8430

Browse files
committed
Disable fetch event listener for testing.
1 parent 8332173 commit 96a8430

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

sw.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -140,22 +140,22 @@ self.addEventListener("activate", (event) => {
140140
});
141141

142142
// eslint-disable-next-line no-restricted-globals
143-
self.addEventListener("fetch", (event) => {
144-
const cacheUrls = [
145-
process.env.NEXT_PUBLIC_VECTOR_TILES_ENDPOINT,
146-
process.env.NEXT_PUBLIC_SO_PDF_ENDPOINT,
147-
];
148-
const shouldFetchFromCache = cacheUrls.some(
149-
(url) => url && event.request.url.startsWith(url),
150-
);
151-
if (shouldFetchFromCache) {
152-
event.respondWith(
153-
caches
154-
.match(event.request)
155-
.then((response) => response ?? fetch(event.request)),
156-
);
157-
}
158-
});
143+
// self.addEventListener("fetch", (event) => {
144+
// const cacheUrls = [
145+
// process.env.NEXT_PUBLIC_VECTOR_TILES_ENDPOINT,
146+
// process.env.NEXT_PUBLIC_SO_PDF_ENDPOINT,
147+
// ];
148+
// const shouldFetchFromCache = cacheUrls.some(
149+
// (url) => url && event.request.url.startsWith(url),
150+
// );
151+
// if (shouldFetchFromCache) {
152+
// event.respondWith(
153+
// caches
154+
// .match(event.request)
155+
// .then((response) => response ?? fetch(event.request)),
156+
// );
157+
// }
158+
// });
159159

160160
const serwist = new Serwist({
161161
clientsClaim: true,

0 commit comments

Comments
 (0)