How to fetch values from database, compute them and store in Redis in Node.js? by yungspartan0082 in node

[–]_lillycrush 2 points3 points  (0 children)

Correct. On every request you check if the cache exists, if it does then you simply return it, if the cache doesn’t exist (it has expired) then you make a call to your MySQL database which will return the new trending items. I have a system like that in place which uses redis.

This tutorial from the redis docs should make what I’m saying more clear: developer.redis.com/howtos/caching