I have been using the nestjs CacheModule along with cache-manager-redis-store as a cache store in an API. Recently I started clustering the app using node's cluster module. But now it seems like each cluster has it's own separate cache. Is it possible for the cache to be shared between all clusters? If not, what are other options for caching alongside clustering?
The workaround I used was ditching the nestjs CacheModule and connecting to the redis server directly using a redis client (node-redis).
I think the nestjs CacheModule is tied to the node process which makes each cluster have a different cache. But since the redis server exists outside node, it does not have the same constraints.