Skip to content

Redis adapter for cache for ThinkJS 3.x

License

Notifications You must be signed in to change notification settings

thinkjs/think-cache-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

think-cache-redis

Build Status Coverage Status npm

Use redis to cache data

Install

npm install think-cache-redis

How to Usage

edit config file src/config/adapter.js, add options:

const redisCache = require('think-cache-redis');
exports.cache = {
  type: 'redis',
  common: {
    timeout: 24 * 3600 * 1000 // millisecond
  },
  redis: {
    handle: redisCache,
    port: 6379,
    host: '127.0.0.1',
    password: ''
  }
}

redis config see at https://github.com/luin/ioredis/