2016-12-07 25 views

回答

0
if you have to store values in cache then node-redis module is best for you. 
Redis is a fast and efficient in-memory key-value store. It is also known as a data structure server, as the keys can contain strings, lists, sets, hashes and other data structures. 

var redis = require('redis'); 
var client = redis.createClient(); 
client.on('connect', function() { 
    console.log('connected'); 
}); 
client.set('framework', 'AngularJS', function(err, reply) { 
    console.log(reply); 
}); 
client.get('framework', function(err, reply) { 
    console.log(reply); 
});