In this article, we are going to implement caching in a node js application using Redis, but, before we delve into the implementation details, let’s explore what caching is and how it can help the performance of our application.

What is caching?

Caching is the process of storing copies of files in a cache or a temporary storage location so that they can be accessed more quickly. -  Cloudflare

Now that we understand what caching is, let’s explore the reason for caching

Why do we cache?

Given many super fast services and options available for users on the Internet today, you don’t want your application to take too long to respond to users’ requests or you risk the chance of your users dumping

your service for a competitor and keep your bounce-rate growing instead of your revenue.

Below are a few of the reasons we cache:

  • To save cost. Such as paying for bandwidth or even volume of data sent over the network.
  • To reduce app response time.

In general, caching done the right way will improve the performance of our application and lead to a win-win situation for us and our users.

#nodejs #redis #javascript

How to Setup Caching in Node.js using Redis
19.10 GEEK