News for hackers. Stuff that matters.
Re:Why Nodejs serves a file with 80x more CPU usage than Nginx? by thinknlive on Friday April 06, 2012 @03:47PM (#3808605)
// response : http response stream // filename : the static file we want to serve

response.writeHead(200 /, ...set http header info (mime, length etc).../ ); stream = fs.createReadStream( filename, { flags: 'r', start: start, end: end }); stream.pipe(response);

There are no comments on this comment yet.