The Need for Caching

Implementing caching in the service worker of a progressive web app makes that app offline capable. Before knowing how caching works, we should understand why we need caching.

Why do we need caching?

Before delving further, we should ask the following questions:

  • Where do we want to use caching?
  • What are its use cases?
  • What do users do on an app if they are offline?

We need caching because we often experience being offline. Here are some situations in which we can have poor or no internet connection at all:

  • We can sometimes be on an elevator or in a crowded place with an unreliable connection.
  • We can experience network issues or not be able to make network requests when connected to public Wi-Fi or hotspots.

Get hands-on with 1200+ tech skills courses.