Tell me about Redis caching flow for nodejs APIs.
My approach is as follow:
- SETEX a key (with some expiry) and the value - response of an endpoint.
- DELETE the key when a new record is created.
Pretty basic one, what are the other techniques involved? How to decide the time for expiry of cache?
Note : I am using MySQL for persisting data