Why plan for offline
Blank screens or endless spinners during dropouts feel broken. Offline-first apps render from local data and sync later (Android Developers, n.d.), echoing local-first software (Kleppmann et al., 2019). On the web, service workers (MDN, n.d.-a) and caching strategies (web.dev, n.d.) reopen viewed screens.
Showing connection status
Show a calm banner like 'You're offline; we'll send changes when connected.' navigator.onLine (MDN, n.d.-b) misses weak signals, so watch failures too. Avoid long waits (Miller, 1968), pair a progress indicator with retry, use an offline empty state, and announce changes per WCAG 2.2 (W3C, 2023) 4.1.3.
Queued actions and sync
Queue offline comments or cart edits and send them later, labeling 'Sending' or 'Pending.' Merge conflicts automatically or let users choose (Kleppmann et al., 2019), allow undo, and block risky actions like payments with an explanation.
FAQ
- Must everything work offline?
- No; start with viewing and writing, and explain when risky tasks need a connection.
- How to detect offline reliably?
- Combine browser status with real request failures and timeouts.
Sources reviewed: 2026-10-27
References
- MDN Web Docs. (n.d.-a). Service Worker API. Caching via service workers.
- MDN Web Docs. (n.d.-b). Navigator: onLine property. Online/offline events and limits.
- web.dev. (n.d.). The offline cookbook. Caching strategies.
- Android Developers. (n.d.). Build an offline-first app. Offline-first architecture.
- Kleppmann, M., Wiggins, A., van Hardenberg, P., & McGranaghan, M. (2019). Local-first software: You own your data, in spite of the cloud. In Proceedings of the 2019 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software (pp. 154–178). ACM. Local-first philosophy.
- Miller, R. B. (1968). Response time in man-computer conversational transactions. In Proceedings of the December 9–11, 1968, Fall Joint Computer Conference, Part I (pp. 267–277). ACM. Response-time thresholds.
- World Wide Web Consortium. (2023). Web Content Accessibility Guidelines (WCAG) 2.2. Criterion 4.1.3 status messages.
