Search code examples
node.jsstreamvideo-streamingbandwidth

Is downloading file from url in nodejs use user internet or works background?


I'm currently building a nodejs streaming app which has to get the file from a third party after that cache it to my virtual machine running node.js (Heroku) local storage.

I want to ask if I'm requesting for download of file in nodejs app, do user internet speed matter even though file is not being downloaded in browser

Can I download file in background when I deploy to heroku without user interaction?

Thanks, if you can explain how internet bandwidth is being consumed by internet providers. I'm concerned about this because the country I'm in internet cost is expensive so I want to reduce internet usage of my users.


Solution

  • In short - the machine/computer running the download code is the one consuming the internet bandwidth.

    So, if your node.js app is running on Heroku, the download is between the Heroku machine and the 3rd party server(s), thus not consuming the user's bandwidth (that data doesn't flow through the user's device).

    However, when the user will stream that file from your node.js app to their device - that'll definitely consume their bandwidth.