Interface Cache
interface Cache {
add(request: RequestInfo | URL): Promise<void>;
addAll(requests: RequestInfo[]): Promise<void>;
addAll(requests: Iterable<RequestInfo>): Promise<void>;
delete(
request: RequestInfo | URL,
options?: CacheQueryOptions,
): Promise<boolean>;
keys(
request?: RequestInfo | URL,
options?: CacheQueryOptions,
): Promise<readonly Request[]>;
match(
request: RequestInfo | URL,
options?: CacheQueryOptions,
): Promise<Response>;
matchAll(
request?: RequestInfo | URL,
options?: CacheQueryOptions,
): Promise<readonly Response[]>;
put(request: RequestInfo | URL, response: Response): Promise<void>;
}
add(request: RequestInfo | URL): Promise<void>;
addAll(requests: RequestInfo[]): Promise<void>;
addAll(requests: Iterable<RequestInfo>): Promise<void>;
delete(
request: RequestInfo | URL,
options?: CacheQueryOptions,
): Promise<boolean>;
keys(
request?: RequestInfo | URL,
options?: CacheQueryOptions,
): Promise<readonly Request[]>;
match(
request: RequestInfo | URL,
options?: CacheQueryOptions,
): Promise<Response>;
matchAll(
request?: RequestInfo | URL,
options?: CacheQueryOptions,
): Promise<readonly Response[]>;
put(request: RequestInfo | URL, response: Response): Promise<void>;
}
Methods
add
- add(request: RequestInfo | URL): Promise<void>
Parameters
- request: RequestInfo | URL
Returns Promise<void>
addAll
- addAll(requests: RequestInfo[]): Promise<void>
Parameters
- requests: RequestInfo[]
Returns Promise<void>
- addAll(requests: Iterable<RequestInfo>): Promise<void>
Parameters
- requests: Iterable<RequestInfo>
Returns Promise<void>
delete
- delete(
request: RequestInfo | URL,
options?: CacheQueryOptions,
): Promise<boolean> Parameters
- request: RequestInfo | URL
Optional
options: CacheQueryOptions
Returns Promise<boolean>
keys
- keys(
request?: RequestInfo | URL,
options?: CacheQueryOptions,
): Promise<readonly Request[]> Parameters
Optional
request: RequestInfo | URLOptional
options: CacheQueryOptions
Returns Promise<readonly Request[]>
match
- match(
request: RequestInfo | URL,
options?: CacheQueryOptions,
): Promise<Response> Parameters
- request: RequestInfo | URL
Optional
options: CacheQueryOptions
Returns Promise<Response>
matchAll
- matchAll(
request?: RequestInfo | URL,
options?: CacheQueryOptions,
): Promise<readonly Response[]> Parameters
Optional
request: RequestInfo | URLOptional
options: CacheQueryOptions
Returns Promise<readonly Response[]>
put
- put(request: RequestInfo | URL, response: Response): Promise<void>
Parameters
- request: RequestInfo | URL
- response: Response
Returns Promise<void>
MDN Reference