Interface CacheConfiguration

Caching-related configuration for a fetch client

interface CacheConfiguration {
    cloneItems?: boolean;
    deepCopy?: ((object: any) => any);
    id: string;
    maxItems?: number | Record<string, number>;
    [key: string]: any;
}

Indexable

  • [key: string]: any

Properties

cloneItems?: boolean

If true, the cache will only return instances that are safe to be modified by the caller. If false, the caller should take care not to modify potentially cached items. The function used to copy values is structuredClone, unless a custom deepCopy function is provided.

Default: false.

deepCopy?: ((object: any) => any)

Only relevant if cloneItems is true. By default it uses the global structuredClone function.

Type declaration

    • (object): any
    • Parameters

      • object: any

      Returns any

id: string

Unique id of the cache provider.

maxItems?: number | Record<string, number>

A limit on the number of items kept in the cache. Note that this applies per table, if it is a number. If an object is passed, keys should table ids and values limit per table.