aschmid00
aschmid00

Reputation: 7158

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 connection types, how can i find out what kind of network the visitor is connected to?

thx

Upvotes: 0

Views: 659

Answers (2)

kagali-san
kagali-san

Reputation: 3082

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.

Upvotes: 0

cdhowie
cdhowie

Reputation: 169353

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.

Upvotes: 1

Related Questions