A Service Worker is a special kind of Web Worker that serves as a proxy for the web app, allowing it to intercept and control network requests. When a request is made while the web app is offline, the Service Worker can intercept it and serve a response from its cache. This cache typically contains static assets like images, stylesheets, JavaScript etc. but it can also contain full HTML pages. In addition to this, it can also defer requests that are made while the user is offline and retry them later when the network is back.
Disconnect your device from the internet by switching off your Wi-Fi or put your device in Airplane Mode. Visit any demo in this app and notice how they keep working (except for demos that require network access like geolocation for example).
To implement offline support for your web app with the PWA Bundle, you just have to enable the service worker.
You can precache routes by adding them to the configuration file.
pwa:
serviceworker: "sw.js"
The service worker also takes care of installing a new version of your web app automatically and as soon as possible.
Please refer to the documentation for more advanced features like URL preload.