Chinedu Okere
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:

Handling File Uploads In Next.js Using UploadThing

Handling file uploads in Next.js using UploadThing

Manage file uploads in your Next.js app using UploadThing, a file upload tool to be used in full-stack TypeScript applications.

Jude Miracle
Jun 21, 2024 ⋅ 15 min read
Exploring Advanced Support For Vite 5 In Storybook 8

Exploring advanced support for Vite 5 in Storybook 8

Explore the latest updates in Storybook 8, focusing on its improved support for Vite 5 as a build tool.

Will Soares
Jun 20, 2024 ⋅ 5 min read
Using Next Js With React Suspense To Create A Loading Component

Using Next.js with Suspense to create a loading component

Next.js 13 introduced some new features like support for Suspense, a React feature that lets you delay displaying a component until the children have finished loading.

Suraj Vishwakarma
Jun 19, 2024 ⋅ 9 min read
Exploring Angular 18's Redirectcommand Class And Let Block

Exploring Angular 18’s RedirectCommand class and @let block

Angular’s latest update brings greater control over redirects and the ability to define and assign variables within the template.

Lewis Cianci
Jun 19, 2024 ⋅ 6 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