TtlCacheOptions
import { TtlCacheOptions } from "jsr:@ende/cache";interface ยท experimental
interface TtlCacheOptions<K, V>Options for the TtlCache constructor.
Properties
onEject
onEject?: (ejectedKey: K, ejectedValue: V) => voidCallback invoked when an entry is removed, whether by TTL expiry, manual deletion, or clearing the cache.
slidingExpiration
slidingExpiration?: booleanWhen true, each get() call resets
the entry's TTL.
If both slidingExpiration and absoluteExpiration are set on an entry,
the sliding window cannot extend past the absolute expiration.
Default: false