Offline-first web apps that actually work on bad connections
Most “offline support” ships as a polite error message. For users on 2G — or on a 3G connection that dies every ten minutes — that is the entire product experience. When I built Babelish, the requirement was blunt: every lesson must open with zero bars.
1. Decide what is core before you touch a service worker
Write the three things a user must be able to do on a plane. For a learning app that was: open a lesson, complete it, keep the streak. Everything else — leaderboards, avatars, AI scores — is progressive.
2. Treat the network as a sync engine, not a data source
The UI reads from local state only. Mutations go into an outbox table with an idempotency key, and a background worker drains it. When the drain fails, nothing breaks: the outbox is just still full.
type Outbox = {
id: string; // idempotency key, generated on device
op: "complete_lesson" | "score";
payload: unknown;
attempts: number;
};
3. Version your content packs
Lessons ship as signed JSON packs with a version field. On boot the client asks for the manifest (a few KB, gzip-friendly) and only downloads changed packs. A 25-language catalogue stays under 4 MB per active language.
4. Make sync visible
A tiny pill (“3 changes queued”) removes almost all support tickets. Users forgive degraded behaviour when they can see it.
The test I keep coming back to: put the phone in flight mode and try to finish your onboarding. If you cannot, the app is online-only with nicer error copy.