1.1. Cache API¶
The cache API provides a temporary key-value based storage.
Functions
-
function
getCache
(string key)¶ Get a cached value identified by its key.
- Return
item value on success, nil otherwise.
- Note
an empty string is returned if the key is not found.
- Parameters
key
: the item identifier.
-
function
setCache
(string key, string value, int expire_secs = nil)¶ Set a cached value identified by a key.
- Note
by convention, cache keys should start with “ntopng.cache.” .
- Parameters
key
: the item identifier.value
: the item value.expire_secs
: if set, the cache will expire after the specified seconds.
-
function
delCache
(string key)¶ Delete a previously cached value.
- Parameters
key
: the item identifier.