about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2026-08-01 23:07:24 +0300
committerAndrew Dolgov <fox@fakecake.org>2026-08-01 23:07:24 +0300
commit78031ae3cdcf39f50f62afb72f34f6d3c39bdf05 (patch)
tree602469be7131ca9823509bff4d6be0ee5c4cb606 /src
parenta9ccf88406a5e7a77ea4f157d43eb337c93d741f (diff)
downloadthe-epube-78031ae3cdcf39f50f62afb72f34f6d3c39bdf05.tar.gz
the-epube-78031ae3cdcf39f50f62afb72f34f6d3c39bdf05.tar.xz
update comment for later
Diffstat (limited to 'src')
-rw-r--r--src/worker.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/worker.ts b/src/worker.ts
index a1e69a0..38757e1 100644
--- a/src/worker.ts
+++ b/src/worker.ts
@@ -123,9 +123,15 @@ sw.addEventListener('fetch', (event) => {
         })());
         return;
     }
-    // index & read UI: online first; if offline, map index pages to offline.html & map all read.html?* to offline read.html
-    // note that instead of hardcoding specific URLs, we handle all user-initiated explicit page navigation requests,
-    // everything else falls back to the next block with cache-first-online-fallback logic
+    /**
+        index & read UI: online first; if offline, map index pages to offline.html & map all read.html?* to offline read.html
+        note that instead of hardcoding specific URLs, we handle all user-initiated explicit page navigation requests,
+        everything else falls back to the next block with cache-first-online-fallback logic
+
+        @todo potentially we could rewrite this to be offline-first as all entrypoints are cached, but we need to
+        somehow deal with substituting index.html with offline.html if network is unavailable without flapping
+        the UI repeatedly between online & offline indexes
+    */
     if (event.request.mode === 'navigate') {
         (event as any).respondWith((async () => {
             try {