API/libsapojs/SAPO/Utility/Cache

[Elements] are optional

Class SAPO.Utility.Cache


class SAPO.Utility.Cache
Utilities for Cache
Defined in Utility/Cache/0.1/lib.js

Function Summary
Object add (String id, Object|String|Array|Number item, Number lifeTime)
Add item to cache object
Object flush()
Remove all data stored
Object get()
Get cached item @param: {String} id - item ID
Object update()
Update item in cache object @param: {String} id - item ID @param: {String|Object|Array|Number} item - item value

Function Details

function add

Object add(String id, Object|String|Array|Number item, Number lifeTime)
Add item to cache object
Parameters:
id - item ID
item - item value
lifeTime - life time (in seconds)
Returns:
true

function flush

Object flush()
Remove all data stored
Returns:
true

function get

Object get()
Get cached item @param: {String} id - item ID
Returns:
data value

function update

Object update()
Update item in cache object @param: {String} id - item ID @param: {String|Object|Array|Number} item - item value
Returns:
true