redis-generational-cache
v1.0.2
Published
redis backed generational cache
Downloads
3
Maintainers
Readme
redis-generational-cache
Installation
npm install redis-generational-cache
Usage
var redis = require("redis");
var GenCache = require("redis-generational-cache");
var cache = new GenCache({redis: redis.createClient()});
cache.set("foo", 42, "bar", function(err, value) {
cache.get("foo", "bar", function(err, value) {
console.log(value); // 42
cache.invalidateGroups("bar", function() {
cache.get("foo", "bar", function(err, value) {
console.log(value); // null
});
});
});
});
This uses redis' sets to store and invalidate groups so operations are not O(1), but they are all atomic.