2022-07-21
2262
#nestjs
Chinedu Okere
124188
Jul 21, 2022 â‹… 8 min read

How to add Redis cache to a NestJS app

Chinedu Okere Full-stack software engineer with a track record of success working in food tech, fintech, and cyber tech. Has a passion for developing cutting-edge UIs and web apps that deliver exceptional user experience, Has expertise in frontend technologies such as HTML, CSS, JavaScript, React, and Next.js, as well as backend technologies such as Node.js/Express.js and databases such as MongoDB/MySQL. Contributes to open source technology documentation.

Recent posts:

Nitro: Revolutionizing Server-Side JavaScript

Nitro.js: Revolutionizing server-side JavaScript

Nitro.js is a solution in the server-side JavaScript landscape that offers features like universal deployment, auto-imports, and file-based routing.

Iniubong Obonguko
Sep 16, 2024 â‹… 11 min read

How to display notification badges on PWAs using the Badging API

Ding! You got a notification, but does it cause a little bump of dopamine or a slow drag of cortisol? […]

Chigozie Oduah
Sep 13, 2024 â‹… 4 min read
JWT Authentication: Best Practices And When To Use It

JWT authentication: Best practices and when to use it

A guide for using JWT authentication to prevent basic security issues while understanding the shortcomings of JWTs.

Flavio Copes
Sep 12, 2024 â‹… 5 min read

Auth.js adoption guide: Overview, examples, and alternatives

Auth.js makes adding authentication to web apps easier and more secure. Let’s discuss why you should use it in your projects.

Clara Ekekenta
Sep 12, 2024 â‹… 10 min read
View all posts

3 Replies to "How to add Redis cache to a NestJS app"

  1. I am getting error.
    63 store?: string | CacheStoreFactory | CacheStore;
    ~~~~~
    The expected type comes from property ‘store’ which is declared here on type ‘CacheModuleOptions’

    1. instead “import * as redisStore from ‘cache-manager-redis-store’;”
      const redisStore = require(‘cache-manager-redis-store’).redisStore;


  2. //importing Get, Inject, Inject, and CACHE_MANAGER from nestjs/common
    import { Controller, Get, Inject, CACHE_MODULE } from ‘@nestjs/common’;

    The CACHE_MODULE here should be CACHE_MANAGER

Leave a Reply