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