Adds an item to the cache or updates the exiting cache item
Key to add
Value to add
Returns an item from the cache with the given key
Key to retrieve
Cache item
Checks if an item with the given key is in the cache and not expired
Key to check
Boolean indicating if a cache item with that ID exists
Checks if an item with the given key is in the cache and not expired
Key to check
undefined if it doesn't exist, otherwise how old the cache entry is in milliseconds
Tries to remove an item from the cache with the given key, if it exists, and the removal is approved by event handlers
Key to remove
Whether an item was removed
Updates the max cache size
new max cache size
This API is in preview and not ready for production use. Expect breaking changes in the future. Class for implementing item caches with a time-based expiration.
T Cache item type