jaredwray / cacheable

Caching for Nodej.js
https://cacheable.org
MIT License
1.45k stars 158 forks source link

Question: how to have memory cache with dynamic TTL? #731

Closed dror-weiss closed 1 month ago

dror-weiss commented 1 month ago

I need to fetch a JWT token from a downstream service, and when it's expired I need to fetch another one. Is this use-case relevant to the "memory" cache, or should I implement my own?

jaredwray commented 1 month ago

@dror-weiss I would suggest you implement your own on this. You could use our cache system and memory cash for it but realistically you end up on a hook and a refresh when it expires.