OptionalmaxThe maximum number of milliseconds an item should remain in the cache.
By default, maxAge will be Infinity, which means that items will never expire.
Lazy expiration occurs upon the next write or read call.
Individual expiration of an item can be specified with the set(key, value, {maxAge}) method.
一个项目在缓存中保留的最大毫秒数。
默认情况下,maxAge 为 Infinity,这意味着项目永不过期。
惰性过期发生在下一次写入或读取调用时。
可以通过 set(key, value, {maxAge}) 方法指定单个项目的过期时间。
The target maximum number of items before evicting the least recently used items.
驱逐最近最少使用项之前的目标最大项目数。
OptionalonCalled right before an item is evicted from the cache due to LRU pressure, TTL expiration, or manual eviction via evict().
Useful for side effects or for items like object URLs that need explicit cleanup (revokeObjectURL).
在项目因LRU压力、TTL过期或通过evict()手动驱逐而即将从缓存中移除时调用。
适用于需要执行副作用操作或需要显式清理的对象URL(如revokeObjectURL)等场景。
LRU Cache Options
LRU 缓存选项