Time a cached item should live before expiring, in milliseconds
Amount of items that can be held in the cache maximum.
Fetch a value from the cache, calling the given function to generate the value if it is not present or it is expired. The result of the function is then cached for future calls.
Use options.missStrategy
to control the revalidation behavior. The default value ("fulfill") will
wait until the fetch operation completes to return a value in the case where a cache miss occurs,
even if an expired cache value is present. The "stale-revalidate" option will instead return the
value found in the cache even when expired, executing the fetch operation if the value is expired
and saving the resulting value back into the cache for future calls.
The key to fetch
A function to define the value of the key if a cache miss occurs
Options for doing the caching.
Get the value present in the cache for the given key regardless of the cache entry's expiration status.
The key to get
Get the cache entry for the given key.
The key to get
Insert the specified item into the cache under the given key, optionally specifying a custom time-to-live. If no time-to-live is specified, the class-wide default is used.
The key for the cache entry
The value to cache
How long the value should remain valid for before revalidation
Generated using TypeDoc
Provides a generic caching mechanism useful for a number of cases