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: 2 months ago
JSON representation
Redis adapter for cache for ThinkJS 3.x
- Host: GitHub
- URL: https://github.com/thinkjs/think-cache-redis
- Owner: thinkjs
- License: mit
- Created: 2017-03-24T02:50:18.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-07-02T00:01:38.000Z (over 3 years ago)
- Last Synced: 2024-10-01T17:51:20.389Z (3 months ago)
- Topics: cache, redis, think-adapter, thinkjs3
- Language: JavaScript
- Homepage:
- Size: 23.4 KB
- Stars: 5
- Watchers: 10
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- think-awesome - think-cache-redis
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/