Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/thinkjs/think-cache-redis

Redis adapter for cache for ThinkJS 3.x
https://github.com/thinkjs/think-cache-redis

cache redis think-adapter thinkjs3

Last synced: 4 months ago
JSON representation

Redis adapter for cache for ThinkJS 3.x

Lists

README

        

# think-cache-redis
[![Build Status](https://travis-ci.org/thinkjs/think-cache-redis.svg?branch=master)](https://travis-ci.org/thinkjs/think-cache-redis)
[![Coverage Status](https://coveralls.io/repos/github/thinkjs/think-cache-redis/badge.svg?branch=master)](https://coveralls.io/github/thinkjs/think-cache-redis?branch=master)
[![npm](https://img.shields.io/npm/v/think-cache-redis.svg?style=flat-square)](https://www.npmjs.com/package/think-cache-redis)

Use redis to cache data

## Install

```
npm install think-cache-redis
```

## How to Usage

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

```js
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/