The type of value stored in the cache.
The type of value stored in the cache.
Retrieves a cached value by key, or initializes it via initFn if absent.
If the key exists in the cache, its expiry is slid forward and the cached
value is returned immediately without invoking initFn.
If a fetch for this key is already in-flight, the pending request is reused
and initFn is not called again.
Otherwise, initFn is called to produce the value, which is then cached.
The cached or freshly initialized value.
A sliding-expiry cache with in-flight deduplication.
Each cache entry's TTL is reset on every read, meaning entries only expire if they go untouched for
ttlInMSmilliseconds — hence "sliding" window.In-flight tracking prevents duplicate concurrent fetches for the same key.