DEV Community

Discussion on: How to Refresh Json Web Tokens (JWT) using Axios Interceptors

Collapse
 
unthrottled profile image
Alex Simons

Had a question, does mem handle cache stampeding?

I know that libraries like dataloader where designed to handle such cases where multiple request for the same object happen at the same time. It will coalesce all the calls, make one call to the function, and supply all the batched calls with the value returned from the function.

Was just wondering if mem does the same thing. Thanks!

Collapse
 
franciscomendes10866 profile image
Francisco Mendes

To tell you the truth, I don't know, I like to use mem whenever I'm going to invoke a function in a consecutive way and I want to cache it for a certain period of time.

It's a simple approach, but it's been working properly so far, but thanks a lot for the question!