News for hackers. Stuff that matters.
Re:“Why are you using Node.js rather than PHP?” by marxdeveloper on Saturday May 25, 2013 @04:32PM (#5768709)
you shouldn't use node.js to serve static files its better to use nginx for that or if you have more resources available serve your files through a content delivery network
Re:“Why are you using Node.js rather than PHP?” by johnhenry on Saturday May 25, 2013 @04:53PM (#5768787)
I'm curious -- what advantages does nginx have over node for serving static files?
Re:“Why are you using Node.js rather than PHP?” by andrewmunsell on Saturday May 25, 2013 @04:57PM (#5768803)
Here's some benchmarks:

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.

Re:“Why are you using Node.js rather than PHP?” by wmil on Saturday May 25, 2013 @05:03PM (#5768826)
It 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.

Re:“Why are you using Node.js rather than PHP?” by ricardobeat on Saturday May 25, 2013 @05:34PM (#5768939)
Node 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.

Re:“Why are you using Node.js rather than PHP?” by mcantelon on Saturday May 25, 2013 @06:58PM (#5769193)
For 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.