Skip to main content

Posts

Showing posts with the label In-Memory Cache

NestJS In-Memory Cache

In this article, we are going to explore the steps to implement the In-Memory Cache in the NestJS application. Caching can significantly improve application performance and its scalability by reducing the workload to generate the content. In-Memory cache creates within the server application memory. Since it uses application memory it delivers content more fastly. But if our application runs on multiple nodes or multiple servers then the in-memory cache can't be shared between the nodes or server each will maintains its own in-memory cache. Create A Sample NestJS Application: Let's understand step by step implementation authentication in NestJs application, so let's begin our journey by creating a sample application. Command To Install CLI: npm i -g @nestjs/cli Command To Create NestJS App: nest new your_project_name Install Cache Npm Packages: NestJS Cache NPM Packages: npm install cache-manager npm install -D @types/cache-manager Register CacheModule: Now let'