How to cache node.js with high concurrency?

how to cache node.js with high concurrency? Is there any example of how node.js,javascript caches if you want to turn 5 requests into one?

Mar.23,2022

if you want to know node.js how to cache, for example, use EventEmitter to store a queue in memory, do not execute the same logic, and only trigger the event to return the result.
but in fact, we often only care about some time-consuming operations, such as sql operations. At this time, we often pay attention not to nodejs itself, but to cache knowledge. Simply using redis to save the results can resist certain concurrency.
of course, caching is not that simple, and there will be all kinds of problems. It is recommended that you first learn about caching. advanced-java

Menu