Introduction
Users have expectations from apps to operate on slow network connections or even when offline. Users expect the content they've most recently interacted with, such as media tracks, to be available and reusable at the moment. Users hope the app tells them instead of silently crashing when a request isn't possible. And users wish to do it all steadily without wasting much of their time. As one can see in this approach, Milliseconds make millions; even a 0.2-second improvement in loading capability can improve conversion by up to 20%. In conclusion: users expect PWAs(Progressive Web Apps) to be reliable, and that's why one has service workers.
Hello Service Workers
When an app targets a resource occupied by the service worker's accommodation, including when a user is offline, the service worker intercepts the request, acting as a network proxy. It can then interpret if it should serve the resource from the cache via the Cache Storage API, from the network as usually would happen without a service worker, or create it from a local strategy. This lets users provide a similar experience to a platform app. It can even work entirely offline.