AniLink - v3.0.0
    Preparing search index...

    Interface ResponseCacheOptions

    Configuration for the opt-in response cache.

    interface ResponseCacheOptions {
        cloneOnRead?: boolean;
        maxEntries?: number;
        ttlMs?: number;
    }
    Index
    cloneOnRead?: boolean

    Whether get() deep-clones the cached entry before returning it. Defaults to true, which preserves the mutation-safety guarantee: a caller that mutates the returned object cannot corrupt the cached copy or affect subsequent reads. Set to false to skip the read-side clone: every cache hit then returns the cached object itself, so a caller that mutates it poisons later hits. Disable only when cached responses are treated as immutable. The write-side clone in set() is unaffected: the cache never aliases the caller's object either way.

    maxEntries?: number

    The maximum number of entries to retain. Defaults to 128. Entries are evicted LRU when the cap is reached.

    ttlMs?: number

    The time-to-live for cached entries, in milliseconds. Defaults to 60_000 (1 minute). 0 disables retention entirely: every set() is a no-op and every get() is a miss, so a shared cache instance can be wired in for shape-compatibility while a particular workload opts out of caching without constructing a second client.