Radical
How-to guides

Keep visited routes available offline

Add remote-mode snapshots and an offline fallback.

See the snapshot lifecycle.

Mark routes

Set eligible routes' static data:

staticData: { radical: { offline: true } },

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.

ReopenExpected result
Visited URL, including query stringStored document
Unvisited URLOffline fallback

Serve over HTTPS or trustworthy localhost. Plain HTTP LAN addresses cannot register workers.

See shell startup checks for Android and iOS.

On this page