469,578 Members | 1,821 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

Switch content if low bandwidth

Is there a way where I can "guess" what relative speed the user's
connection is?

Currently, the client is wanting some graphical intensive content and
I'd like to be able to warn users on dial-up to allow them to go to a
"gracefully degraded" version.

I thought of simply putting up a question for users to answer but the
client would rather it happen, more or less, automatically.

Andrew Poulos
Sep 24 '07 #1
7 3875
Andrew Poulos wrote:
Is there a way where I can "guess" what relative speed the user's
connection is?
No. Ask them instead.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Sep 24 '07 #2
pr
Andrew Poulos wrote:
Is there a way where I can "guess" what relative speed the user's
connection is?
You could adopt the approach used by "test your internet connection"
sites, calculating a connection speed from the time taken to download an
image of a known size. It's not infallible, but should be able to tell
a dial-up from a fast cable connection on most occasions.

There's one at http://bandwidthplace.com/speedtest/. Run a free test and
view source on the "testing..." page.
Sep 24 '07 #3
On Sep 23, 11:41 pm, Andrew Poulos <ap_p...@hotmail.comwrote:
Is there a way where I can "guess" what relative speed the user's
connection is?

Currently, the client is wanting some graphical intensive content and
I'd like to be able to warn users on dial-up to allow them to go to a
"gracefully degraded" version.

I thought of simply putting up a question for users to answer but the
client would rather it happen, more or less, automatically.

Andrew Poulos
....

I reckon you could start the download of a test image, record the time
before it loads, and thereafter. I'd still give the user a chance to
set their own speed though.

Sep 24 '07 #4
pr wrote:
Andrew Poulos wrote:
>Is there a way where I can "guess" what relative speed the user's
connection is?

You could adopt the approach used by "test your internet connection"
sites, calculating a connection speed from the time taken to download an
image of a known size. It's not infallible, but should be able to tell
a dial-up from a fast cable connection on most occasions.
It cannot. Because it cannot detect how much caching is involved.

The most ridiculous part of this test is that you have to select the region
you are in. As if that would mean anything in a globally distributed,
routed network.
PointedEars
Sep 24 '07 #5
On Sep 24, 9:50 am, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
pr wrote:
Andrew Poulos wrote:
Is there a way where I can "guess" what relative speed the user's
connection is?
You could adopt the approach used by "test your internet connection"
sites, calculating a connection speed from the time taken to download an
image of a known size. It's not infallible, but should be able to tell
a dial-up from a fast cable connection on most occasions.

It cannot. Because it cannot detect how much caching is involved.

The most ridiculous part of this test is that you have to select the region
you are in. As if that would mean anything in a globally distributed,
routed network.
Perhaps the point of this test is not to directly detect the user's
actual connection speed, but their connection speed relative to your
server. Therefore, if your server is in the U.S.A. but the user is in
South Africa, they may well have a T1 connection, but the effective
speed is like a dialup connection. That may give you all the
information you need to determine that "rich," heavy content will take
a long time to download as well.

-David
Sep 24 '07 #6
David Golightly wrote:
Perhaps the point of this test is not to directly detect the user's
actual connection speed, but their connection speed relative to your
server. Therefore, if your server is in the U.S.A. but the user is in
South Africa, they may well have a T1 connection, but the effective
speed is like a dialup connection. That may give you all the
information you need to determine that "rich," heavy content will take
a long time to download as well.
Given the number of possible different ways each packet could be routed from
host A to host B in a WAN such as the Internet, the results are utterly
insignificant, no matter the connection.
PointedEars
--
"Use any version of Microsoft Frontpage to create your site. (This won't
prevent people from viewing your source, but no one will want to steal it.)"
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Sep 24 '07 #7
Thomas 'PointedEars' Lahn wrote:
David Golightly wrote:
>Perhaps the point of this test is not to directly detect the user's
actual connection speed, but their connection speed relative to your
server. Therefore, if your server is in the U.S.A. but the user is in
South Africa, they may well have a T1 connection, but the effective
speed is like a dialup connection. That may give you all the
information you need to determine that "rich," heavy content will take
a long time to download as well.

Given the number of possible different ways each packet could be routed from
host A to host B in a WAN such as the Internet, the results are utterly
insignificant, no matter the connection.

Which shows a remarkable ignorance of how backbone ISP routing is
*actually* done.

Stick to Java script P.E. You can't be an expert in everything, and
trying may not be a wise course if you don't want to look foolish.

In practice, between any two point in the internet, there are normally
just two routes at the IP level. The route there and the route back.

Unless a fault occurs they will tend to persist, being the ones
calculated to be the most advantageous by the ISPs in between.

You can tell this is so using traceroute, which explores the forward route.

It nearly always shows the same set of machines up the route..
Whilst in theory the actual usable bandwidth of any given point to point
connection cannot be guaranteed exactly, it is generally between 20% and
100% of the bandwidth of the weakest link. Any more is impossible, any
less is generally synonymous with severe packet loss and users giving up
on the link or the ISP upgrading the link to get packet loss down.

So very meaningful tests can be done on any given link: the transfer of
e.g. a random image or some such, timed, will give a good indication of
transit speeds and because it is random, will not be cached..

Now thats the bit I DO know about. The Javascript I don't, so over to
someone who does, to indicate how to time a download...
Sep 24 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by clueless_google | last post: by
19 posts views Thread by rdavis7408 | last post: by
10 posts views Thread by lg | last post: by
3 posts views Thread by C. Feldmann | last post: by
2 posts views Thread by Annalyzer | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.