#nestjs cache system question

7 messages · Page 1 of 1 (latest)

velvet ermine
#

I'm doing cache work for a backend I made. How can I have the data of different users cached in the same url?

#

The cache manager provided by nestjs doesn't seem appropriate because it simply supports caching for urls.

raw remnant
#

you can give unique keys to each value using redisStore

#

redisStore shown in the document does not work for me
cache-manager-redis-yet you may need to use this, you can review the issues

velvet ermine
#

I solved it by changing the logic of the traceby function of the cache interceptor. By including the user's unique ID in the key value, different data is cached for each user even in the same url.

#

There is a precondition that the jwt passport library that puts the user id in req.user is required. lol