feat: add /sessions to pre-cache and clarify scan/notes offline coverage
This commit is contained in:
@@ -65,9 +65,9 @@ A critical feature is the ability to link tasting notes to a bottle that hasn't
|
|||||||
### Service Worker (`public/sw.js`) - "Ironclad" Strategy
|
### Service Worker (`public/sw.js`) - "Ironclad" Strategy
|
||||||
The Service Worker implements an aggressive offline reliability strategy:
|
The Service Worker implements an aggressive offline reliability strategy:
|
||||||
|
|
||||||
- **Pre-Caching**: The landing page (`/`) and core static assets are cached during installation.
|
- **Pre-Caching**: The landing page (`/`), core static assets, and the sessions overview (`/sessions`) are cached during installation.
|
||||||
- **Fail-Fast Navigation**: Navigation requests have a 3-second timeout to prevent UI hangs during network transitions.
|
- **Fail-Fast Navigation**: Navigation requests have a 3-second timeout to prevent UI hangs during network transitions.
|
||||||
- **Root App Shell Fallback**: If a URL is not found in the cache while offline, the SW serves the Root (`/`). This allows Next.js to bootstrap and handle the routing client-side using local Dexie data.
|
- **Root App Shell Fallback**: If a URL is not found in the cache while offline, the SW serves the Root (`/`). This allows Next.js to bootstrap and handle the routing client-side (including Scan and Note features embedded on the homepage) using local Dexie data.
|
||||||
- **RSC Data Resiliency**: Requests to `/_next/data/` return an empty JSON object if they fail, preventing "Application Error" screens.
|
- **RSC Data Resiliency**: Requests to `/_next/data/` return an empty JSON object if they fail, preventing "Application Error" screens.
|
||||||
- **Stale-While-Revalidate**: Applied to static assets to ensure immediate UI response.
|
- **Stale-While-Revalidate**: Applied to static assets to ensure immediate UI response.
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
const CACHE_NAME = 'whisky-vault-v4'; // Increment version for "Ironclad" strategy
|
const CACHE_NAME = 'whisky-vault-v5'; // Increment version for refined strategy
|
||||||
|
|
||||||
// CONFIG: Core pages and assets to pre-cache immediately on install
|
// CONFIG: Core pages and assets to pre-cache immediately on install
|
||||||
const CORE_PAGES = [
|
const CORE_PAGES = [
|
||||||
'/', // Dashboard / Home (Includes Scan and Tasting features)
|
'/', // Dashboard / Home (Includes Scan and Tasting features)
|
||||||
|
'/sessions', // Tasting Sessions overview
|
||||||
];
|
];
|
||||||
|
|
||||||
const STATIC_ASSETS = [
|
const STATIC_ASSETS = [
|
||||||
|
|||||||
Reference in New Issue
Block a user