Setu-TS
    Preparing search index...

    Interface ICacheApi

    The subset of the platform's Cache this package calls.

    A real caches.default satisfies it structurally.

    Scope is per-datacenter. caches.default is the colo's own cache: a hit rate measured in one location says nothing about another, and a delete does not evict globally. It is an edge-latency optimisation, not a shared store — for that, use CAPABILITIES.CACHE over KV.

    0.2.0

    interface ICacheApi {
        delete(request: string | Request): Promise<boolean>;
        match(request: string | Request): Promise<Response | undefined>;
        put(request: string | Request, response: Response): Promise<void>;
    }
    Index
    • Looks up a cached response.

      Parameters

      • request: string | Request

        The cache key, as a Request or a URL string

      Returns Promise<Response | undefined>

      The cached response, or undefined on a miss

    • Stores a response.

      Throws on the platform's own refusals — a non-GET request, status 206, Vary: *, or an uncleared Set-Cookie — which is why assessCacheability checks first rather than letting this reject.

      Parameters

      • request: string | Request

        The cache key

      • response: Response

        The response to store

      Returns Promise<void>