默认集成redis缓存,只需配置即可

This commit is contained in:
ap 2022-03-31 15:38:58 +08:00
parent 56d86f647e
commit d6b88dd107
2 changed files with 21 additions and 1 deletions

View File

@ -4,7 +4,7 @@
"description": "",
"private": true,
"dependencies": {
"@cool-midway/core": "^5.0.7",
"@cool-midway/core": "^5.0.8",
"@cool-midway/es": "^5.0.2",
"@cool-midway/file": "^5.0.3",
"@cool-midway/pay": "^5.0.0",

View File

@ -1,6 +1,8 @@
import { CoolConfig } from '@cool-midway/core';
import { MODETYPE } from '@cool-midway/file';
import { MidwayConfig } from '@midwayjs/core';
// import * as redisStore from 'cache-manager-ioredis';
import * as fsStore from 'cache-manager-fs-hash';
export default {
// 修改成你自己独有的key
@ -18,6 +20,24 @@ export default {
'.html': 'ejs',
},
},
// 本地缓存
cache: {
store: fsStore,
options: {
path: 'cache',
ttl: -1,
},
},
// redis缓存
// cache: {
// store: redisStore,
// options: {
// host: '127.0.0.1',
// port: 6379,
// password: '',
// db: 1,
// },
// },
// cool配置
cool: {
// 是否自动导入数据库