Skip to content

Defined in: packages/cache/src/cache.ts:243

What CacheEvictionPolicy.chooseVictim may consult while it chooses.

K

readonly protectedKey: K | undefined

Defined in: packages/cache/src/cache.ts:250

The key being set when the cache already holds it, which must not be chosen; undefined when the key being set is new. A key that is itself undefined is indistinguishable here, so a policy over such keys must not rely on this field to tell the two apart.


readonly isExpired: (key) => boolean

Defined in: packages/cache/src/cache.ts:257

Return true when the cache holds the key and its entry has expired by the clock reading of the set that asked; false otherwise, and always without timeToLive. An expired victim is dropped without being reported, so returning one first spares a live entry.

K

boolean