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??
Asked
Active
Viewed 620 times
1 Answers
0
The general idea is to:
- Install redis on your machine. It is its own service. See redis documentation for details.
- 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. - Read node redis documentation, which is basically just the redis command documentation
- 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