4 ms·
Express supports sendfile(), so it should be about as efficient as any other Web server. I wonder if anybody has benchmarked it.
by wmf 14y ago
Express supports sendfile(), so it should be about as efficient as any other Web server. I wonder if anybody has benchmarked it.
- sausagefeet 14y agoNginx has a lot of tricks to handle this for you, including caching and working over multiple cores. There is also less framework overhead in Nginx because it's not trying to do dynamic content. I'd be surprised if Node beats Nginx for serving static content, but alas I do not have any proof. At the very least it will use time in Node that is better off serving dynamic content.
- willvarfar 14y agoI'm curious, is that an asynchronous sendfile?
- mhansen 14y agoYes.
- willvarfar 14y agoas in spinning off a thread to serve it?
- willvarfar 14y agoHmm, web servers differ dramatically is serving single files. The approach I favour is to put varnish in front of a classic slow script webserver (tornado, but use node if you prefer). Tornado has this neat way of baking-in versioning to static content so clients (and proxies) can do aggressive caching http://www.tornadoweb.org/documentation/overview.html#static-files-and-aggressive-file-caching http://www.tornadoweb.org/documentation/overview.html#static... Best of both worlds.