aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/service-worker.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/service-worker.js b/src/service-worker.js
index 5db8abb3..63e69008 100644
--- a/src/service-worker.js
+++ b/src/service-worker.js
@@ -37,6 +37,11 @@ self.addEventListener("fetch", (event) => {
const url = new URL(event.request.url);
const cache = await caches.open(CACHE);
+ if (url.pathname.startsWith("/api")) {
+ // Allow the network to handle these requests
+ return;
+ }
+
// `build`/`files` can always be served from the cache
if (ASSETS.includes(url.pathname)) {
const response = await cache.match(url.pathname);