Static Caching or Pre-Caching
Learn pre-caching and how to implement it in a progressive web app.
Pre-caching
In pre-caching, we cache static assets during the service worker’s install
event to serve them during the fetch
event. After pre-caching, our app loads even if the user is offline because we don’t make network requests. All the static assets are stored in the cache.
Now, let’s practice what we should store in our static cache. Consider the following HTML file as the index.html
file for a web app and think about what should be in the static cache.
Get hands-on with 1200+ tech skills courses.