3 ms·
I'm curious -- what advantages does nginx have over node for serving static files?
by johnhenry 13y ago
I'm curious -- what advantages does nginx have over node for serving static files?
- andrewmunsell 13y agoHere's some benchmarks: http://stackoverflow.com/questions/9967887/node-js-itself-or-nginx-frontend-for-serving-static-files http://stackoverflow.com/questions/9967887/node-js-itself-or... Nginx is pretty well tuned for serving static files quickly and efficiently, whereas Node.js is not. At scale, you're much better off serving files through Nginx because it'll do it faster.
- wmil 13y agoIt can gzip static files automatically, resume HTTP downloads, and do other HTTP tricks that are only safe with static files. Plus it's considered more secure, and presumed to have a performance advantage.
- ricardobeat 13y agoNode can do all those tricks and more, since it's a platform for network applications. transload.it built their file upload/transcoding service on node.js. but yeah, in short nginx performs better and uses less memory.
- mcantelon 13y agoFor production node.js apps, it's pretty normal to use both. nginx ends up handling static requests, because that's what it does best, and relaying anything else to node.