about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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 {