Cache

Cache

new Cache(name, cacheTimeopt)

Source:
Parameters:
Name Type Attributes Default Description
name String

Identifier of the Cache instance

cacheTime Number <optional>
0

Time to keep data, 0 for never expire

Methods

getKey(key) → {*}

Source:

Retrieve data saved under given key.

Parameters:
Name Type Description
key String

Key which will be read

Returns:

Stored data

Type
*

remove()

Source:

Permanently delete entire cache.

removeKey(key)

Source:

Remove key from cache and delete associated data.

Parameters:
Name Type Description
key String

Key to remove

save()

Source:

Permanently write entire cache to disk.

setKey(key, value)

Source:

Save data under a given key.

Parameters:
Name Type Description
key String

Key that should represent the data

value *

Data to be stored