使用 nodejs 反向代理对带宽有帮助吗
Does using nodejs reverse proxy helps in terms of bandwidth
我想知道使用 nodejs 反向代理是否对带宽有任何影响,例如您有两台服务器 server 1 --> mainWebsite.com
和 server 2 --> videosWebsite.com
负责提供视频服务。所以当我这样做时:
app.all("/videos/:id/", function(req, res) {
apiProxy.web(req, res, {target: 'videosWebsite.com'});
});
是 mainWebsite.com
从 videosWebsite.com
下载视频然后将其发送到客户端(意味着两台服务器带宽的完成)还是仅在 videosWebsite.com
上完成(当我说带宽我的意思是服务视频所需的带宽)。
我的问题很简单,但我不知道如何解释,也许下面的例子会很清楚。
每个视频都是 1 Gb,当我们通过反向代理请求它 100 次时,这使得 videosWebsite.com
向客户端上传 100 Gb 的带宽,我的问题是:制作反向代理或包含它的服务器怎么样,他是否从 videosWebsite.com
下载 100Gb 而不是将其发送到客户端(将 100Gb 上传到客户端)?
Does mainWebsite.com download the video from videosWebsite.com then send it to the client
是的,当您按照显示的方式实施代理时,您最终会使用双倍的带宽。当客户端请求视频时,视频从目标服务器下载到你的服务器,然后从你的服务器发送到客户端。
Every single video is 1 Gb, when we request it 100 times through reverse proxy, that makes videosWebsite.com upload 100 Gb of bandwidth to the client, my question is: what about the server that made the reverse proxy or who contain it, does he download that 100Gb from videosWebsite.com than send it to the client (upload 100Gb to the client) or not ?
从服务器的角度来看,您将使用 100GB 的下载带宽(将视频从目标服务器检索到您的服务器)和 100GB 的上传带宽(将视频从您的服务器发送到客户端)。
避免带宽加倍的唯一方法是让客户端直接从目标下载视频,而不是通过您的代理。如果这些资源是静态的,不会改变,你也可以在自己的服务器上实现缓存,避免缓存中任何资源的双倍带宽。
我想知道使用 nodejs 反向代理是否对带宽有任何影响,例如您有两台服务器 server 1 --> mainWebsite.com
和 server 2 --> videosWebsite.com
负责提供视频服务。所以当我这样做时:
app.all("/videos/:id/", function(req, res) {
apiProxy.web(req, res, {target: 'videosWebsite.com'});
});
是 mainWebsite.com
从 videosWebsite.com
下载视频然后将其发送到客户端(意味着两台服务器带宽的完成)还是仅在 videosWebsite.com
上完成(当我说带宽我的意思是服务视频所需的带宽)。
我的问题很简单,但我不知道如何解释,也许下面的例子会很清楚。
每个视频都是 1 Gb,当我们通过反向代理请求它 100 次时,这使得 videosWebsite.com
向客户端上传 100 Gb 的带宽,我的问题是:制作反向代理或包含它的服务器怎么样,他是否从 videosWebsite.com
下载 100Gb 而不是将其发送到客户端(将 100Gb 上传到客户端)?
Does mainWebsite.com download the video from videosWebsite.com then send it to the client
是的,当您按照显示的方式实施代理时,您最终会使用双倍的带宽。当客户端请求视频时,视频从目标服务器下载到你的服务器,然后从你的服务器发送到客户端。
Every single video is 1 Gb, when we request it 100 times through reverse proxy, that makes videosWebsite.com upload 100 Gb of bandwidth to the client, my question is: what about the server that made the reverse proxy or who contain it, does he download that 100Gb from videosWebsite.com than send it to the client (upload 100Gb to the client) or not ?
从服务器的角度来看,您将使用 100GB 的下载带宽(将视频从目标服务器检索到您的服务器)和 100GB 的上传带宽(将视频从您的服务器发送到客户端)。
避免带宽加倍的唯一方法是让客户端直接从目标下载视频,而不是通过您的代理。如果这些资源是静态的,不会改变,你也可以在自己的服务器上实现缓存,避免缓存中任何资源的双倍带宽。