match method

JSPromise<Response?> match(
  1. RequestInfo request, [
  2. MultiCacheQueryOptions options
])

The match() method of the CacheStorage interface checks if a given Request or URL string is a key for a stored Response. This method returns a Promise for a Response, or a Promise which resolves to undefined if no match is found.

You can access CacheStorage through the Window.caches property in windows or through the WorkerGlobalScope.caches property in workers.

Cache objects are searched in creation order.

Note: CacheStorage.match is a convenience method. Equivalent functionality is to call cache.match on each cache (in the order returned by CacheStorage.keys) until a Response is returned.

Implementation

external JSPromise<Response?> match(
  RequestInfo request, [
  MultiCacheQueryOptions options,
]);