July 2018
Intermediate to advanced
354 pages
8h 51m
English
Similar to the match method, the matchAll() method takes request and options (optional) parameters. The method returns a promise that resolves an array of matching responses. Unlike the same method on the Caches object, it only returns matches in the specifically named cache.
The main difference between matchAll and match is that the match method returns the first response it matches.
The matchAll method is useful when you need to match responses using a route, not just a specific URL. For example, if you want to get a list of all a podcast's banner images, you could do something like this:
caches.open("podcasts").then(function(cache) { cache.matchAll('/images/').then(function(response) { response.forEach(function(element, ...Read now
Unlock full access