Interface GenericCacheConfig

Configuration for requests with caching enabled

interface GenericCacheConfig {
    activeCache?: string | string[];
    defaultCacheControl?: CacheControl;
    forcedCacheControl?: CacheControl;
    key: string;
    mode?: "cacheControl" | "fetchFirst" | "race";
    table?: string;
}

Hierarchy (view full)

Properties

activeCache?: string | string[]

Specify specific cache(s) to use

defaultCacheControl?: CacheControl

These settings are applied if the respective headers are not set on the cached response.

forcedCacheControl?: CacheControl

These settings overwrite the respective response headers.

key: string

Specify the cache key for this particular request

mode?: "cacheControl" | "fetchFirst" | "race"

Default: "cacheControl", i.e. evaluate response headers to determine max cache time etc., and try to read from cache first before sending any request to the server.

table?: string

Specify a table name for the request; if none specified, a default is used. This can be used to separate requests of different kinds.