Retrieving Items from the Cache

Learn how to read the items stored in the app's cache storage.

Finding an item in the cache

In the service worker’s fetch event handler, we can listen to the fetch events and check our cached assets to see whether the requested resource is available in the cache. We’ll use the caches.match() method to search all our sub-caches for the requested resource. This mechanism of checking and responding with cached assets is implemented below.

Get hands-on with 1200+ tech skills courses.