easycache
多功能的cache模块
Last updated 5 years ago by jifeng.zjd .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install easycache 
SYNC missed versions from official npm registry.

easycache

多功能的cache模块

介绍

目前支持的缓存类型:

  • memory (lru)
  • http server (mlru)
  • redis
  • tair

优点

  • 不同的存储, 但用同一个客户端访问
  • 简单的接口调用,最大限度上规避掉一些潜在的坑

安装

npm install easycache

使用

tair

var cache = require('easycache');
var tair = cache({
  type: 'tair',
  // 以下配置参考 tair 
  dataId: 'datapid',
  namespace: 1,
  // 秒级别,默认 24小时
  expire: 86400
});

lru

var cache = require('easycache');
var lru = cache({ type: 'lru', max : 256000000, maxAge : 86400000 });

redis

var cache = require('easycache');
var redis = cache({ type: 'redis', redis: { server: ['127.0.0.1:6379', '127.0.0.1:6378'], password: 'helloworld' } });

mlru

var cache = require('easycache');
var mlru = cache( { type: 'mlru', max : 256000000, maxAge : 86400000, port: port });

Current Tags

  • 0.0.6                                ...           latest (5 years ago)

6 Versions

  • 0.0.6                                ...           5 years ago
  • 0.0.5                                ...           5 years ago
  • 0.0.4                                ...           5 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (9)
Dev Dependencies (6)

Copyright 2014 - 2016 © taobao.org |