Testing Offline Experiences
You'll learn how to systematically verify that your Progressive Web App works reliably when the network is unavailable or unreliable.
Building offline functionality is only half the battle—you need to prove it works before users encounter it in the wild. Testing offline experiences requires simulating various network conditions and verifying your service worker behaves correctly in each scenario.
Your Testing Toolkit
DevTools Network Throttling lets you simulate different network speeds and conditions. Open the Network panel and use the throttling dropdown to select "Offline" or custom profiles like "Slow 3G". This mimics poor connectivity without touching your system settings.
Airplane Mode provides a true system-level offline test. Turn it on to ensure your app handles complete network absence, not just slow responses. This catches edge cases throttling might miss—like DNS failures or socket timeouts.
Service Worker Tools in the Application panel let you inspect worker status, view cached resources, and manually unregister/update workers. Use "Update on reload" during development to bypass the service worker cache. The "Offline" checkbox here forces the service worker to run as if offline, even with network access.
Testing Strategy
Start by verifying your precached assets load offline. Clear your cache, load the page online, then go offline and refresh—everything should still appear. Test navigation between pages in your app's scope. Try submitting forms or making API requests to ensure they queue properly (if you implemented request queuing). Check that your offline indicators appear correctly when connectivity drops.
Test the transition from online to offline by loading pages, then throttling mid-session. This reveals synchronization issues.
Key Takeaway: Combine DevTools throttling, airplane mode, and service worker inspection to thoroughly validate offline functionality across different network conditions and failure modes.