Sunday, 16 April 2017

efficient way to send files using express.js

Here's a question I don't even know how to search for it in the web and probably it's a dumb question:

Would it be more efficient for a web server to set download requests and file streams on different ports like 21(ftp) than using default 80/443(http/https) ports? or even use another server to handle these requests so that there would be no longer heavy traffics over http/https connections.Is it even possible to do such action?

If yes, how can I set these settings on Express.js? and if not, what's the regular way of handling heavy downloads?

I know that it's possible to send a file over user's browser using response object like this:

app.get('/download', function(req, res){
    res.download('image.jpg');
}

And as far as I know it uses http/https. I want to know if it's possible to set this on port 21 manually.

So there are two questions:

  1. Is it efficient to handle downloads on different port?
  2. How is it possible to set responses on different port?

thanks for clearing this up



via Brian SP

No comments:

Post a Comment