Caching while using cluster module
amit777 opened this issue · 3 comments
When using the cluster module, it seems like the memory cache will not be shared amongst each worker. I'm wondering if this module can be incorporated easily:
https://github.com/PaquitoSoft/memored
Have you run into issues or other potential solutions to having a shared memory cache amongst workers?
You can probably write a store
module that wraps memored
and use it with node-cache-manager
. The built-in memory store is more of an example than anything.. I don't expect many people use it in production. As long as your store has the basic methods like get
, set
, and del
, and the methods have the same signature as the built-in memory store, it should work.
got it.. thanks. I'll contribute it back once I get around to it.
Sounds good. If you want to contribute the store, you should do it in a separate repo/npm, like https://github.com/dial-once/node-cache-manager-redis
-Bryan