UNPKG

redis-plus-lru-cache

Version:
40 lines (31 loc) 856 B
/** * Created by ManjeshV on 3/17/2015. */ var lruCachePlusRedis = { lruCache: { max: 500, length: function (n) { return n * 2 }, displose: function (key, n) { n.close() }, maxAge: 1000 * 60 * 60 }, redis: { port: 6379, servers: '192.168.220.229' }, prefix: "rplc_test_" } var cache = require('./')(lruCachePlusRedis) cache.set("xx",{n:"n"}) cache.set("xxc",{n:"n"}) cache.set("xxd",{n:"n"}) cache.flushByPrefix("rplc_test_") //cache.flush() //cache.set("CacheAboutUsPage",{name:"About Us","content":"Lorem Ipsum Sample Text"},function(){ // console.log("Cache Set"); // cache.get("CacheAboutUsPage",function(error,data){ // if(!error){ // console.log("Data found:",data) // } // }) //})