How-to guides
Keep visited routes available offline
Add remote-mode snapshots and an offline fallback.
See the snapshot lifecycle.
Configure the server
Wrap defaultStreamHandler with offlineHandler from @akshatowo/radical/tanstack-start-server in src/server.ts.
Add the fallback
Create public/offline.html.
Register the worker
Register in the root mount effect:
void registerOffline({
mode: config.mode,
production: import.meta.env.PROD,
base: import.meta.env.BASE_URL,
});Verify snapshots
After worker activation in a production build, visit each exact URL through document navigation, then stop the UI server.
| Reopen | Expected result |
|---|---|
| Visited URL, including query string | Stored document |
| Unvisited URL | Offline fallback |
Serve over HTTPS or trustworthy localhost. Plain HTTP LAN addresses cannot register workers.