From ac241fae2e4db45cc525128d806fd57b1382c47c Mon Sep 17 00:00:00 2001 From: kamaji Date: Sat, 7 Feb 2026 22:07:14 -0600 Subject: [PATCH] Precache page routes for offline support Add /capture, /queue, /browser to SW precache so these pages work offline without needing a prior visit. Capture and queue are fully functional offline since they use local IndexedDB. Co-Authored-By: Claude Opus 4.6 --- app/static/sw.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/static/sw.js b/app/static/sw.js index fe576ab..ea22bdb 100644 --- a/app/static/sw.js +++ b/app/static/sw.js @@ -1,9 +1,9 @@ // NextSnap Service Worker // Provides offline-first caching for the app shell -const CACHE_VERSION = 'nextsnap-v20'; -const APP_SHELL_CACHE = 'nextsnap-shell-v16'; -const RUNTIME_CACHE = 'nextsnap-runtime-v16'; +const CACHE_VERSION = 'nextsnap-v21'; +const APP_SHELL_CACHE = 'nextsnap-shell-v17'; +const RUNTIME_CACHE = 'nextsnap-runtime-v17'; // Offline fallback page (served when network fails and no cached version exists) const OFFLINE_PAGE = ` @@ -27,6 +27,9 @@ button:active{opacity:0.8} // Assets to cache on install const APP_SHELL_ASSETS = [ '/', + '/capture', + '/queue', + '/browser', '/static/css/style.css', '/static/js/app.js', '/static/js/auth.js',