Redis Cache Middleware Example


I thought I’d share my middleware for using ioredis as a cache simply.

JS

Then all you have to do for your routes is:

JS

Easy to reuse. Remember, use ioredis. It has built in promises.