node-quickcache
A full-featured caching module for node.js
Usage
var cache = ; cache;cache;console;
Example
Trigger
Setup trigger for an entry.
var cache = ; cache; cache;cache; // will be triggered
Counter
See how many times the entry has been called.
var cache = ;cache; cache;for var i = 0; i < 500; i++ cache; console; // will be 500
Functions
set(key, value)
- set entryget(key)
- get entrygetCount(key)
- returns the number of the entry has been calleddelete(key)
- delete entryclear()
- clean up all entriesincrby(key, incr)
- increments the number stored at key by incrementttl(key, time, timeoutCallback)
- set time-to-live for an entryuseCounter()
enable/disable counterisEmptyCache(key)
- checks whether the cache is emptyisValidKey(key)
- checks whether the entry existsisValidTrigger(key)
- checks whether the entry has a triggerkeys()
- returns an array of the entry keys in cachesize()
- returns the number of entries in cachetrigger(key, conditions, callbackFunction)
adds a trigger for an entrygetTriggerCount(key)
- returns the number of the trigger has been usedremoveTrigger(key)
- remove trigger from an entry