Given a request, how can I figure it out which cache it belongs to?
match
, despite searching in all caches, will only give me the cached response. I would like to retrieve both the cache object / cache's name and the cached response.
How can I find which cache a service worker response belongs to?
148 views Asked by João Pires At
1
If you need to know the cache the response is in, I'm afraid you'll need to call
match
on each of the caches individually until you find one where there's a match.The code could look something like this: