Amazon Vinyl
    Preparing search index...

    Type Alias CacheEntryOptions

    type CacheEntryOptions = {
        cacheControlDefaults?: CacheControl;
        cacheControlOverrides?: CacheControl;
        cacheKey?: string | null;
        responseIsValid?: (response: Response) => Promise<boolean>;
    }
    Index
    cacheControlDefaults?: CacheControl

    Cache control directive defaults. These will be used unless overridden by the response headers or the cache control overrides.

    CacheControl directives will be overwritten in the order:

    • cacheControlDefaults
    • response headers
    • cacheControlOverrides
    cacheControlOverrides?: CacheControl

    Allows the client to set cache control overrides. This object is merged with the actual cache control header.

    For example, to allow cached items to be used 1 day after they are stale while asynchronously revalidating the cache, set { staleWhileRevalidate: 24 * 60 * 60 }

    These overrides do not change the header cached, only how the cached header is read. If noStore is true, the entry will not be cached.

    cacheKey?: string | null

    If set, the response will be cached under this identifier, not based on the request. This is required for caching POST requests.

    responseIsValid?: (response: Response) => Promise<boolean>

    If set, checks the response if it should be used. This affects whether to cache and whether to use the cached fallback.