New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why doesn't cache.match support cacheName
#917
Comments
I don't know why you may want to filter by cache name inside a cache, plus, I guess you just confused P.S. No idea what MDN says and why. |
Yea, the spec defines a single
The Also note that |
Okay, so if I've understood the replies correctly, firstly the MDN docs are wrong, but in particular, instead of writing this: return caches.open('special-assets').then(cache => cache.match(request)); I can write this: return caches.match(request, { cacheName: 'special-assets' }); Is that right? |
Yes, seems correct. But also add return caches.match(request, { cacheName: 'special-assets' }).catch(function() {}); |
I think the MDN docs are correct, if confusing. If you are doing caches.match, then you want this page; https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage/match Where cacheName has an effect. If you are using Cache.match (different object type from CacheStorage) then cacheName has no effect. |
Seems like this isn't an issue. Reopen if I'm wrong. |
Going by the docs on MDN it reads regarding the
options.cacheName
to thecache.match()
method:It seems odd that I can't filter the cache that I'm searching for the
.match()
, but I can filter when I use.matchAll()
. Without the filtering, I have to open the specific cache, and then run the match against the specific cache.Have I misunderstood or does it actually make sense to add the support to
.match()
?The text was updated successfully, but these errors were encountered: