Skip to content

CacheConfig

CacheConfig = object

Defined in: packages/fetch-kit/src/types.ts:80

Default-cache configuration applied at client creation.

optional autoCacheGet?: boolean

Defined in: packages/fetch-kit/src/types.ts:94

When true, GET requests (and GraphQL queries) are cached automatically. Defaults to true when a CacheConfig is supplied. Set explicitly to false to require per-request opt-in.


optional keyFn?: (method, url, body) => string

Defined in: packages/fetch-kit/src/types.ts:88

Compute the cache key. Defaults to "<METHOD> <url> [body fingerprint]".

HttpMethod

string

unknown

string


optional maxSize?: number

Defined in: packages/fetch-kit/src/types.ts:84

Maximum entries kept in the default in-memory store. Defaults to 100.


optional store?: CacheStore

Defined in: packages/fetch-kit/src/types.ts:86

Custom store (e.g. localStorage-backed, Redis). Overrides maxSize.


optional ttl?: number

Defined in: packages/fetch-kit/src/types.ts:82

Default time-to-live for cache entries in milliseconds. Defaults to 60_000.