0

I am developing REST API using Node,Mongoose and restify.I want to use redis as a caching system for API.So Can anyone tell me how to implement this??

Ritesh Kumar
  • 79
  • 2
  • 8

1 Answers1

0

The general idea is to:

  1. Install redis on your machine. It is its own service. See redis documentation for details.
  2. Install redis for node. npm install redis If you're using default ports, now that package can talk to the redis service running on your machine.
  3. Read node redis documentation, which is basically just the redis command documentation
  4. Store and retrieve stuff in redis from your app. Now it is caching things for you.

There is a little more to it than that, but those are the basics! Determining what data to store, when to retrieve etc will come with practice.

Good luck!

clay
  • 5,917
  • 2
  • 23
  • 21