【发布时间】:2021-07-11 02:04:39
【问题描述】:
在官方文档中,这是将缓存管理器与 Redis 一起使用的正确方法:
import * as redisStore from 'cache-manager-redis-store';
import { CacheModule, Module } from '@nestjs/common';
import { AppController } from './app.controller';
@Module({
imports: [
CacheModule.register({
store: redisStore,
host: 'localhost',
port: 6379,
}),
],
controllers: [AppController],
})
export class AppModule {}
来源:https://docs.nestjs.com/techniques/caching#different-stores
但是,我没有找到任何关于如何使用 REDIS_URI 传递 Redis 实例数据的文档。我需要将它与 Heroku 一起使用,我相信这是一个常见的用例。
【问题讨论】:
-
看起来您已经在
cache-manager-redis-store包中发现了该限制:p github.com/dabroek/node-cache-manager-redis-store/pull/…
标签: heroku caching redis nestjs