Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
多功能的cache模块
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
tests
.gitignore
.npmignore
Makefile
README.md
index.js
package.json

README.md

easycache

多功能的cache模块

介绍

目前支持的缓存类型:

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

优点

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

安装

npm install easycache

使用

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 });
Something went wrong with that request. Please try again.