Class: Cache

Cache()

new Cache()

Represents a Cache instance
Do not call constructor directly.
Source:
See:

Methods

delete(key)

Remove an entry
Parameters:
Name Type Description
key string entry key
Source:

get(key, removeopt) → {object}

Get an entry from the cache
Parameters:
Name Type Attributes Default Description
key string entry key
remove boolean <optional>
false remove this entry on get
Source:
Returns:
- entry value
Type
object

increment(key, increment, dValue, ttlopt, asyncopt)

Increment or Decrement an entry by the value 'increment', set a default value of 'dValue' if the entry doesn't exist
Parameters:
Name Type Attributes Default Description
key string entry key
increment integer positive or negative value of the increment
dValue integer default value if key does not exist
ttl integer <optional>
0 entry time-to-live in seconds. 0, means it will never leave the cache
async boolean <optional>
false run in async mode
Source:

put(key, value, ttlopt) → {JsonObject}

Add or update an entry into the cache
Parameters:
Name Type Attributes Default Description
key string entry key
value object entry value
ttl integer <optional>
0 entry time-to-live in seconds. 0, means it will never leave the cache
Source:
Returns:
- list of entries
Type
JsonObject