@nextcloud/dialogs
    Preparing search index...

    Interface Cache

    The Cache interface provides a persistent storage mechanism for Request / Response object pairs that are cached in long lived memory. Available only in secure contexts.

    MDN Reference

    interface Cache {
        add(request: URL | RequestInfo): Promise<void>;
        addAll(requests: RequestInfo[]): Promise<void>;
        delete(
            request: URL | RequestInfo,
            options?: CacheQueryOptions,
        ): Promise<boolean>;
        keys(
            request?: URL | RequestInfo,
            options?: CacheQueryOptions,
        ): Promise<readonly Request[]>;
        match(
            request: URL | RequestInfo,
            options?: CacheQueryOptions,
        ): Promise<Response | undefined>;
        matchAll(
            request?: URL | RequestInfo,
            options?: CacheQueryOptions,
        ): Promise<readonly Response[]>;
        put(request: URL | RequestInfo, response: Response): Promise<void>;
    }
    Index

    Methods

    • The add() method of the Cache interface takes a URL, retrieves it, and adds the resulting response object to the given cache.

      MDN Reference

      Parameters

      Returns Promise<void>

    • The addAll() method of the Cache interface takes an array of URLs, retrieves them, and adds the resulting response objects to the given cache.

      MDN Reference

      Parameters

      Returns Promise<void>

    • The delete() method of the Cache interface finds the Cache entry whose key is the request, and if found, deletes the Cache entry and returns a Promise that resolves to true.

      MDN Reference

      Parameters

      Returns Promise<boolean>

    • The keys() method of the Cache interface returns a representing the keys of the Cache.

      MDN Reference

      Parameters

      Returns Promise<readonly Request[]>

    • The match() method of the Cache interface returns a Promise that resolves to the Response associated with the first matching request in the Cache object.

      MDN Reference

      Parameters

      Returns Promise<Response | undefined>

    • The matchAll() method of the Cache interface returns a Promise that resolves to an array of all matching responses in the Cache object.

      MDN Reference

      Parameters

      Returns Promise<readonly Response[]>

    • The put() method of the Often, you will just want to Window/fetch one or more requests, then add the result straight to your cache.

      MDN Reference

      Parameters

      Returns Promise<void>