superid / super-cache Goto Github PK
View Code? Open in Web Editor NEW缓存管理模块,支持自定义存储引擎,可运行于Node.js & Browser
License: MIT License
缓存管理模块,支持自定义存储引擎,可运行于Node.js & Browser
License: MIT License
cache.get('key', function (name, callback) {
callback(null, data, {
// 可选参数
ttl: 60, // 缓存时间
notNull: true // 如果为true,则结果为null或undefined时不缓存,默认为false
});
}, callback);
支持Redis和Memcache的连接池
在连接需要身份验证的Redis和Memcache时候,可以在配置时候传入auth
参数
Redis的auth方法:
var redis = require('redis'),
RDS_PORT = 6379, //端口号
RDS_HOST = '127.0.1.1', //服务器IP
RDS_PWD = 'porschev',
RDS_OPTS = {auth_pass:RDS_PWD}, //设置项
client = redis.createClient(RDS_PORT,RDS_HOST,RDS_OPTS);
或者
client = redis.createClient(RDS_PORT,RDS_HOST,RDS_OPTS);
client.auth(RDS_PWD,function(){
console.log('通过认证');
});
Memcached的auth方法:
memjs.Client.create([user:pass@]server1[:11211]);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.