Bird's-eye checklist: offline coverage for the rest of the site
Today the worker only falls back for /, /threads, /threads/{id}, /tags, /tags/{tag}, the compose pages, the Outbox and Offline Reading status. Everything else ends in a browser network error. The snapshot has threads, posts, excluded posts, unavailable expansions and public keys; it has no profiles, events, media index or search index.
"Where possible" should mean one explicit decision per route, not a blanket cache.
0. Fix the boundary and vocabulary
S - snapshot view: rendered locally from the saved public database.
H - prebuilt HTML: a public static artifact cached with its assets.
L - local shell: compose, Outbox, Offline Reading status, local SQLite viewer.
O - online-only: explicit "needs a connection" page; never cached.
1. Stop the ambiguous failures first
2. Snapshot: add only what the new views need
3. Route-by-route target
| Route | Today | Target | First implementation |
|---|---|---|---|
/recent/ | browser error | S | query saved posts by created_at; cutoff label |
/activity/ | browser error | S or O | only if items can be derived from saved posts/threads; otherwise O |
/gallery/ | browser error | S + media | image metadata + thumbnails within budget |
/users/ | browser error | S | directory from profiles; local filter |
/profiles/{slug} | browser error | S | public summary + saved posts/threads; "posts outside the snapshot" note |
/calendar, /calendar/{tag}/{date} | browser error | S or O | events from saved threads; "saved events only" |
/search | browser error | S (local) | search saved titles/bodies/tags; scope and age label |
/posts/{id} | browser error | S | resolve to saved post permalink |
/about, /docs, /instance, /tools, /tools/bookmarklets | browser error | H | cache static artifacts and assets from manifest |
/tools/sqlite | browser error | L/H | cache sql-wasm and a chosen DB; label local file |
/tools/outbox, /offline/, /compose/* | L (partial) | L | finish draft restore/edit/export and parent checks |
/messages, /inbox, /unread, /account/key, /invites, /lobby, /staged, /users/pending, operator tools | browser error | O | explicit unavailable screen |
/qdb/*, /forte/* | browser error | decision | only if enabled/public; otherwise O |
Two rules for the table:
Use S when the view must respect the saved bounds, deletion state or "not downloaded" state.
Use H only for public, stable pages whose full HTML can be cached and invalidated as a release. Do not cache a profile or thread HTML page and also render it from the snapshot; one route, one source of truth.
4. Media and embeds
5. Refresh, storage and honesty
6. Verification and rollout
Route registry + unavailable page + H pages.
Snapshot profiles +
/users/,/profiles/,/recent/,/activity/.Local
/search./gallery/+ media budget./calendar/,/qdb/,/forte/only if they clear the public/data-boundary test.
Definition of done
Every public route either renders from saved public data with its age and scope visible, or shows a deliberate "not available offline" screen with a reason and a way back. No route ends in a browser network error. No private, personalized or operator data enters the cache. No local draft or queued action is presented as sent.
The cheapest first slice is the route registry + the unavailable screen + H caching of the already-built static pages (/about, /docs, /instance, /tools, /tools/bookmarklets). The highest-value next slice is profiles/users/recent, because the snapshot already has the post and key data; it mainly needs a public profile table and three views. Local search is valuable but should wait for an explicit index decision.
Checked against public/service_worker.js, public/assets/offline_reader.js, src/ForumRewrite/Offline/PublicOfflineSnapshotBuilder.php, src/ForumRewrite/Host/StaticArtifactBuilder.php, and docs/plans/backlog/offline_support_roadmap.md.