문제

I'm interested to know if anyone has worked on a website where they need to cater for users with vastly different bandwidths? I'd like to tailor a site to different user groups

1) Low Bandwidth ( <56kbps dial up)
Low Res Images - no javascript framework, no background images

2) Medium Bandwidth ( ~256kbps dial up)
Medium res images, smaller background images, small amount of jquery

3) High Bandwidth ( > 1Mbps)
Full site

Are there any techniques that I could use to test bandwidth speed, then maybe set a cookie to remember (to stop page running test every single time), and tailor included css/javascript and image urls depending on the result?

도움이 되었습니까?

해결책

At my previous company (a WiMAX ISP), I wrote a speed test for customers so that they could test the speed of their connection to our network. I ended up with a custom web server hacked together in Perl, that served static pages in a sub-domain.

The speed test itself was a JavaScript tool that sent a randomly created(*) string to a special address on the server, which made a mark when the transmission began, then when the string was completely received, and then sent an equally random string back to the client, marking the end of this operation. Now the server had three timestamps (start receive -> end receive == start send -> end send), calculating upstream and downstream speed and sending these as the last line of text in its response. The JavaScript part extracted the last line and knew the connection speed.

If you use a standard hoster, chances are you can't just implement your own server, though...

(*) Random string generated so that some routers could not taint the measured data due to compression of the the data stream

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top