Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/evt/lib/types/lib.dom.ts>Cache

💧EventEmitter's typesafe replacement
Go to Latest
interface Cache
import { type Cache } from "https://deno.land/x/evt@v2.4.19/lib/types/lib.dom.ts";

Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec.

Methods

add(request: RequestInfo): Promise<void>
addAll(requests: RequestInfo[]): Promise<void>
delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>
keys(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Request>>
match(request: RequestInfo, options?: CacheQueryOptions): Promise<Response | undefined>
matchAll(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Response>>
put(request: RequestInfo, response: Response): Promise<void>