algo.Cache
Description
An ephemeral key-value storage that automatically cleans up old entries.
There are 2 ways to fill the cache. First, you can use set() to directly add a key-value pair to it. Second, you can provide a callback function that is called with a key and returns the corresponding value when get() could not find an entry.
Constructor
new algo.Cache(onAllocate?, onFree?, options?)
Creates an instance of Cache.
Methods
clear()
Deletes all entries.
get(key)
Looks up an entry.
remove(key)
Deletes an entry.
set(key, value)
Creates or changes an entry.