开发者

find out connection speed on http request?

is it possible to find out the connection speed of the client when it requests a page on my website.

i want to serve video files but depending on how fast the clients network is i would like to serve higher or lower quality videos. google analytics is showing me the clients con开发者_如何学编程nection types, how can i find out what kind of network the visitor is connected to?

thx


No, there's no feasible way to detect this server-side short of monitoring the network stream's send buffer while streaming something. If you can switch quality mid-stream, this is a viable approach because if the user's Internet connection suddenly gets burdened by a download you could detect this and switch to a lower-quality stream.

But if you just want to detect the speed initially, you'd be better off doing this detection on the client and sending the results to the server with the video request.


Assign each request a token /videos/data.flv?token=uuid123, and calculate amount of data your webserver sends for this token per second (possible check for multiple tokens at one username at a time period). You can do this with Apache sources and APR.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜