cacher-utils
v0.1.3
Published
Small utils for co-cacher & cacher-promise
Downloads
1,369
Readme
node-cacher-utils
Part of co-cacher & cacher-promise
example
var utils = require('./'),
co = require('co'),
storage = utils.getCacheStorage();
co(function *(){
var result = yield storage.set("test",260,60);
var result = yield storage.get("test");
console.log(result);
}).catch(onerror);
function onerror(err) { console.error(err.stack); }
adapters
memcached
redis
config
module.exports = {
// https://github.com/3rd-Eden/node-memcached
memcached: {
servers: 'localhost:11211', // You can either use: String, Array, Object
options: {
poolSize: 20
}
},
// https://github.com/mjackson/then-redis
redis: {
url: 'tcp://localhost:6379'
},
cache: {
expires: 120, // Default cache expires in seconds
storage: 'memcached',
key: {
prefix: 'cw_',
crc32: false
}
}
};