3 ms·
node.js isn't really that fast for traditional apps, but if you were to compare, it's pretty much on levels of nginx and it's actually slower serving static fil
by jaequery 14y ago
node.js isn't really that fast for traditional apps, but if you were to compare, it's pretty much on levels of nginx and it's actually slower serving static files. only in few cases node.js shows its power, i.e; real-time apps/games. i wouldn't build any full-blown websites in node.js. only a certain piece on the site i'd do it in node, like a widget or something.
- rockyj 14y agoI agree. I would do the same but I couldn't find any examples of doing this on the web. One could potentially use Redis or a AMQP as a middleman to integrate node.js's push with a Rails app. If I get sometime on the weekend I would like to try this.
- louischatriot 14y agoYep, you shouldn't be using node to serve static files anyway. This is something a reverse proxy such as nginx should do. Node can then be used to serve either as a pure API (serving json with express is the easiest way) for a webapp or render the webpages.
- wamatt 14y agonginx is not a bad choice, but would instead recommend node-http-proxy for most projects (including production). It's fast, easy to setup (npm install), and relatively hardened, while still keeping everything JS. As for static assets, those should probably be served from a CDN anyway, if one is concerned with performance.
- louischatriot 14y agoI agree about the CDN, even though for us performance is not so critical we need to use a CDN (yet). I didn't know node-http-proxy but it sounds interesting I'll check it out.