October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

Offline-First React Apps: Build for Unreliable Networks

React apps need browser APIs—not React alone—to work offline. Learn how to cache the app shell, persist pending edits, handle worker updates, and test real offline behavior.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

React does not make an application work offline on its own. A practical offline-first React app combines a service worker to handle network requests, Cache Storage for URL-addressable resources, and IndexedDB for structured records and queued changes. The key is to decide which tasks must remain usable without a connection, then give each resource and action a deliberate offline behavior.

Define what “offline-first” means for your app

Start with the user’s task, not a caching plugin. For each screen and action, decide whether it should show a saved snapshot, display an explicit offline state, or be unavailable until the network returns. Also decide how stale the information may be before it becomes unsafe or misleading. As the MDN Caching guide puts it, “The optimal caching strategy is dependent on the particular web app and how it is used.”

As an Amazon Associate I earn from qualifying purchases.

Separate the application shell—the minimum interface needed to launch and navigate—from data-backed views. A cached shell can let a user open the app, but it does not mean every screen has useful data or every action can be completed offline.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Know which browser component does what

Component Best fit Important constraint
React page and application logic Rendering screens, showing stale or pending status, collecting user input, and initiating retries. React does not intercept requests or persist data by itself.
Service worker Handling in-scope fetch events and deciding whether to answer from the network, a cache, or a fallback. It runs separately from the page, has no DOM access, and can be stopped and restarted. Its memory is not durable.
Cache Storage Request/response resources such as HTML, JavaScript, stylesheets, images, and selected API responses. It stores responses associated with requests; it is not a general-purpose structured-record database.
IndexedDB Structured app records, user-specific data, and a durable outbox of intended writes. It is browser-managed origin storage, not a backup system; users or browser policies can remove stored data.

These boundaries are described in the MDN Service Worker API documentation and web.dev’s storage overview. Avoid using localStorage as a service-worker database: it is synchronous and is not available in service-worker contexts.

#1 Best Overall
Sale
TP-Link Roam 6 AX1500 Portable Wi-Fi 6 Travel Router (TL-WR1502X)
  • 𝐑𝐨𝐚𝐦 𝟔 𝐀𝐗𝟏𝟓𝟎𝟎 𝐃𝐮𝐚𝐥-𝐁𝐚𝐧𝐝 𝐓𝐫𝐚𝐯𝐞𝐥 𝐑𝐨𝐮𝐭𝐞𝐫 - Delivers fast Wi-Fi 6 speeds (1201 Mbps on 5 GHz, 300 Mbps on 2.4 GHz) for uninterrupted video streaming, downloading, and online gaming all at the same time. Actual Wi-Fi speeds vary based on source bandwidth, environment, and distance to devices.
  • 𝐒𝐞𝐜𝐮𝐫𝐞 𝐖𝐢-𝐅𝐢 𝐎𝐧-𝐓𝐡𝐞-𝐆𝐨 - Connects to public Wi-Fi and creates a private, secure network for all your devices. Supports multiple devices at once, ideal for hotels, Airbnbs, airports, and even home use. VPN connectivity enables secure remote work. This is not a Mi-Fi device or mobile hotspot.
  • 𝐂𝐨𝐧𝐧𝐞𝐜𝐭 𝐀𝐧𝐲𝐰𝐡𝐞𝐫𝐞, 𝐀𝐧𝐲 𝐖𝐚𝐲 - Offers (1) Router Mode for Ethernet or USB (phone) tethering connections, (2) Hotspot Mode for secure access to public WiFi , and (3) AP/RE/Client Mode to extend WiFi, add WiFi to wired setups, or connect wired devices wirelessly.
  • 𝐏𝐨𝐫𝐭𝐚𝐛𝐥𝐞 𝐚𝐧𝐝 𝐃𝐮𝐫𝐚𝐛𝐥𝐞 𝐃𝐞𝐬𝐢𝐠𝐧 - The Roam 6 AX1500, measuring a compact 4.09 in. × 3.54 in. × 1.10 in., is a pocket-sized travel router perfect for your next trip or adventure.
  • 𝐌𝐮𝐥𝐭𝐢𝐩𝐥𝐞 𝐰𝐚𝐲𝐬 𝐭𝐨 𝐩𝐨𝐰𝐞𝐫 𝐲𝐨𝐮𝐫 𝐫𝐨𝐮𝐭𝐞𝐫 - Power the Roam 6 via its USB-C port using the included adapter or any 5V/3A PD power source, like a power bank.

Make the app shell and routes load offline

During installation, a service worker can precache the minimum HTML, scripts, styles, and offline fallback needed to launch a useful interface. Its fetch handler can then apply a policy to matching requests. But registration and activation follow a lifecycle: the first page load may happen before the worker controls the page. The first visit therefore needs to work online without assuming worker control.

Single-page app routing needs explicit attention. A deep link or refreshed route must receive an application entry document even when offline. Caching hashed JavaScript and CSS alone does not guarantee that a server or service worker can return the app shell for a route. Test both direct navigation and refresh after an online visit.

Keep the precache focused on launch-critical assets. Large or rarely used files consume storage without necessarily making core tasks more resilient. The service worker should also remove obsolete cache versions deliberately when a new version activates, while avoiding deletion of data the current app still needs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
GL.iNet GL-BE3600 Slate 7 Wi-Fi 7 Travel Router Touchscreen 2.5G
  • 【DUAL BAND WIFI 7 TRAVEL ROUTER】Products with US, UK, EU, AU Plug; Dual band network with wireless speed 688Mbps (2.4G)+2882Mbps (5G); Dual 2.5G Ethernet Ports (1x WAN and 1x LAN Port); USB 3.0 port.
  • 【NETWORK CONTROL WITH TOUCHSCREEN SIMPLICITY】Slate 7’s touchscreen interface lets you scan QR codes for quick Wi-Fi, monitor speed in real time, toggle VPN on/off, and switch providers directly on the display. Color-coded indicators provide instant network status updates for Ethernet, Tethering, Repeater, and Cellular modes, offering a seamless, user-friendly experience.
  • 【OpenWrt 23.05 FIRMWARE】The Slate 7 (GL-BE3600) is a high-performance Wi-Fi 7 travel router, built with OpenWrt 23.05 (Kernel 5.4.213) for maximum customization and advanced networking capabilities. With 512MB storage, total customization with open-source freedom and flexible installation of OpenWrt plugins.
  • 【VPN CLIENT & SERVER】OpenVPN and WireGuard are pre-installed, compatible with 30+ VPN service providers (active subscription required). Simply log in to your existing VPN account with our portable wifi device, and Slate 7 automatically encrypts all network traffic within the connected network. Max. VPN speed of 100 Mbps (OpenVPN); 540 Mbps (WireGuard). *Speed tests are conducted on a local network. Real-world speeds may differ depending on your network configuration.*
  • 【PERFECT PORTABLE WIFI ROUTER FOR TRAVEL】The Slate 7 is an ideal portable internet device perfect for international travel. With its mini size and travel-friendly features, the pocket Wi-Fi router is the perfect companion for travelers in need of a secure internet connectivity on the go in which includes hotels or cruise ships.

Choose a request strategy by consequence of staleness

Strategy Typical behavior Good fit Trade-off
Cache-first Return a cached response when available; use the network when it is not. Versioned static assets or content that can tolerate being served locally. Fast and available offline, but content may be stale.
Network-first Try the network first, then use a cached response if the request fails. Data where freshness matters and a prior response is still useful offline. Prioritizes fresh data when connected, but may be slower and needs a cached fallback to work offline.
Stale-while-revalidate Show a cached response immediately while requesting an update in the background. Views where quick display matters and a brief stale result is acceptable. The user may initially see old data; the interface should make the refresh behavior understandable.

There is no single policy for an entire app. A versioned script, a frequently changing account balance, and a help page have different consequences if stale. Choose per resource, and communicate freshness where it affects user decisions. The MDN guide to caching explains these trade-offs.

Persist offline edits before calling them saved

For a user action that changes data, write the intended change to IndexedDB before telling the user it is safely stored. An offline edit should survive a page reload, so keep it in a persistent outbox rather than only in React state or worker memory.

  1. Record the intent. Save the operation, relevant record identifier, payload, and enough metadata to retry it. Keep the data model and migration plan appropriate to your app.
  2. Show its state. Distinguish pending, syncing, succeeded, and needs-attention states. “Saved on this device” is different from “synced to your account.”
  3. Retry when possible. Attempt synchronization when connectivity returns and provide a foreground retry path while the app is open.
  4. Handle duplicates and conflicts. Use server-supported idempotency keys or another deduplication method where appropriate. Define what happens if the remote record changed after the user’s local edit.
  5. Report failures usefully. A server rejection is not the same as being offline. Preserve the local intent when appropriate and explain what the user can do next.

The browser APIs do not decide conflict resolution or prevent duplicate writes for you; those rules depend on your data model and server. Design them as part of the feature, not as an afterthought to caching.

Rank #3
NETGEAR Nighthawk M6 5G WiFi 6 Mobile Hotspot Router (MR6110) – Blazing Fast Wireless Hotspot Router, Unlocked, Certified with AT&T - White (Renewed)
  • Unlocked, portable hot spot for 5G and 4G LTE around the world, certified with AT&T requires a 5G compatible SIM card. Ask your 5G wireless network provider for the best 5G data plan for your needs

Treat Background Sync as an enhancement

Background Sync can ask the browser to retry queued work later, but it is not available in all widely used browsers, and the browser controls when the event runs. It requires a secure context. Keep the outbox durable and the app’s foreground retry path functional regardless of support. See MDN’s Background Synchronization API reference for current compatibility information.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If you use Workbox Background Sync, understand what counts as a failed request: its default plugin behavior queues requests when the fetch fails with a network error, but does not automatically treat HTTP 4xx or 5xx responses as failures. Configure response handling if server errors should be retried, and avoid retrying permanent validation or authorization errors indefinitely. See the Workbox Background Sync documentation.

Plan for worker updates and storage loss

A new service worker can wait while tabs controlled by the previous worker remain open. Make update prompts clear: tell users whether a refresh is needed and what might happen to unsent work. Immediate activation is possible, but switching versions while old pages are open can create incompatibilities between code and cached resources. Test the update flow with multiple tabs and the actual deployment setup.

Rank #4
NETGEAR Nighthawk M7 5G Mobile Hotspot with eSIM, WiFi 7, Up to 3.6 Gbps
  • WIFI 7 SPEEDS UP TO 3.6 GBPS, ANYWHERE YOU GO: Powered by a 5G or 4G cellular connection, M7 delivers fast, reliable WiFi 7 performance. Real-world speeds depend on carrier network, signal strength, location, and connected devices
  • GLOBAL COVERAGE WITH NETGEAR eSIM IN 140+ COUNTRIES: Purchase 5G or 4G data plans from the Nighthawk app with no contracts. Requires free NETGEAR account. Coverage and speeds vary by country and carrier
  • US CARRIER SUPPORT: The M7 is certified for AT&T and T-Mobile, unlocked for flexible use across compatible carriers. For US local carrier eSIM or SIM activation and data plan details, contact your carrier directly
  • POWERFUL BUILT IN SECURITY - includes firewall protection, WPA3 encryption, and automatic firmware updates help protect your data when using public WiFi
  • CONNECT UP TO 32 DEVICES AND FREE UP YOUR PHONE: A dedicated hotspot outperforms phone tethering. Connect laptops, tablets, and smart devices simultaneously while keeping your phone free

Cache Storage and IndexedDB belong to the site’s origin, and available quota and eviction behavior vary by browser. Users can clear site data; browsers may also evict stored data under their policies. Handle missing records and caches gracefully, and do not treat browser storage as the only copy of irreplaceable information unless you have separately designed backup or export behavior. See web.dev’s storage guidance.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose an implementation path

Workbox provides service-worker modules for routing, precaching, fallback responses, and retrying requests when connectivity returns. For a Vite-based React app, Vite PWA’s getting-started guide documents React integration and plugin options for generating a manifest, service worker, and registration code. Plugin options and instructions can change, so use the documentation matching the version installed in your project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Whichever tool you choose, keep the responsibilities visible in your design: React renders the interface and status; the worker handles eligible requests; Cache Storage holds response resources; IndexedDB holds structured data and pending writes. A plugin can reduce setup work, but it cannot choose acceptable staleness, resolve conflicting edits, or make a first visit work without a network.

Best Value
Roam 6 AX1500 Portable Wi-Fi 6 Travel Router Dual-Band USB C 3.0
  • 𝐑𝐨𝐚𝐦 𝟔 𝐀𝐗𝟏𝟓𝟎𝟎 𝐝𝐮𝐚𝐥-𝐛𝐚𝐧𝐝 𝐬𝐩𝐞𝐞𝐝𝐬 - Wi-Fi 6 Speeds up to 1,201 Mbps (5 GHz) and 300 Mbps (2.4 GHz) for up to 60 devices simultaneously. Actual Wi-Fi speeds vary based on source bandwidth, environment, distance to devices, and obstacles. ◇§
  • 𝐏𝐨𝐫𝐭𝐚𝐛𝐥𝐞 𝐚𝐧𝐝 𝐝𝐮𝐫𝐚𝐛𝐥𝐞 𝐝𝐞𝐬𝐢𝐠𝐧 - Roam 6 AX1500 is a pocket-sized travel router compactly designed for trips and adventures, featuring a 1 Gbps WAN/LAN port and a 1 Gbps LAN port for reliable wired connectivity.
  • 𝗦𝗲𝗰𝘂𝗿𝗲 𝗪𝗶-𝗙𝗶 𝗼𝗻-𝘁𝗵𝗲-𝗴𝗼 - Connects to public Wi-Fi and creates a private, secure network for all your devices. Supports multiple devices at once, ideal for hotels, Airbnbs, airports, and even home use. VPN connectivity enables secure remote work.
  • 𝐌𝐮𝐥𝐭𝐢𝐩𝐥𝐞 𝐰𝐚𝐲𝐬 𝐭𝐨 𝐜𝐨𝐧𝐧𝐞𝐜𝐭 - (1) Router Mode: Connects to public Wi-Fi, ISP, or phone (USB tethering). (2) AP/RE/Client Mode: Adds WiFi to wired setups, extends WiFi, or connects wired devices wirelessly.
  • 𝐎𝐮𝐫 𝐜𝐲𝐛𝐞𝐫𝐬𝐞𝐜𝐮𝐫𝐢𝐭𝐲 𝐜𝐨𝐦𝐦𝐢𝐭𝐦𝐞𝐧𝐭 - TP-Link is a signatory of the U.S. Cybersecurity and Infrastructure Security Agency’s (CISA) Secure-by-Design pledge. Advanced security is integrated into the device’s design, development, and ongoing maintenance.

Test the behavior users will actually encounter

Run the production build on the deployed HTTPS origin or a supported localhost setup. A successful manual “offline” toggle is only one part of validation. Include lifecycle, routing, persistence, and failure cases:

  • Visit with a working connection, allow the service worker to install and activate, then reload.
  • After an online visit, launch the app offline and confirm the shell and expected screens appear.
  • Open a deep link directly and refresh it while offline.
  • Inspect a cached screen after its data has become stale; verify the freshness state and refresh behavior are clear.
  • Make an edit offline, reload, reconnect, and confirm the edit retries and reaches a success state.
  • Test a server rejection and verify the user sees an actionable needs-attention state rather than an endless retry.
  • Test on a browser path without Background Sync and confirm foreground retry works.
  • Keep an old controlled tab open while deploying an update; check the waiting state, refresh prompt, activation, and cache cleanup.
  • Clear site data or simulate unavailable storage and verify the app explains what cannot be recovered.

Browser developer tools can help inspect service-worker registration, worker state, and cache contents. The Vite PWA testing guide provides additional guidance for testing service-worker behavior.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.