0
我運行一個node.js進程,模塊緩存在哪裏? 如何獲得此進程的模塊緩存?如何在node.js中獲得一個流程模塊緩存?
我運行一個node.js進程,模塊緩存在哪裏? 如何獲得此進程的模塊緩存?如何在node.js中獲得一個流程模塊緩存?
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);
});