PWA Offline Mode when server is offline and client is online

Viewed 87

Offline mode works except for one very odd scenario.

  1. PWA is installed and service workers/assets are cached
  2. App entry point (app.component.ts::ngOnInit) has initialization logic
  3. IF initialization fails AND the user's device has internet THEN ping the server (and check if the database is connectable)
  4. IF the server is down THEN activate offline mode

The above works, for the FIRST cold launch of the app when the server is down. On the second cold launch with the server down, I see a "502 Bad Gateway".

I notice in application tab in Chrome, storage increases from 7.3MB to 10.6MB on first cold launch with server down.

This might be a service worker related issue?

0 Answers
Related