問題タブ [multiserver]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
21 参照

node.js - クラスターを使用する場合、res.locals は機能しますか?

https://nodejs.org/api/cluster.html https://github.com/RGBboy/express-flash/blob/master/lib/express-flash.js

express-flash と connect-flash は、res.locals への単なるアドオンです。res.locals の問題は、クラスターを使用すると、理論的には、メッセージが受信者に到達しない確率が 1/(ワーカーの数) になることです。これをテストすることはできませんが、これは重要なことです。これは本当ですか、それとも間違っていますか?

req.session を使用してメッセージを送受信するのが最善の方法であることがわかりましたか?