Determining a User's Bandwidth

Hello -

I have this idea I was thinking of implementing on some future projects, and I thought I'd run it by you experts to hear what you think.

Some Websites have a high bandwidth and low bandwidth version for broadband and dialup users. But usually it involves selecting which version you want to see.

I was thinking of developing a simple script that takes getBytesLoaded() over the Date() object to determine how much time it takes a user's browser to download a certain number of bytes to determine a transfer rate, then if they exceed a minimum requirement, automatically launch them into the high bandwidth version of the site. The code is easy enough.

But how reliable would this really be? It's hard to test this, cause I don't have access to an array of test computers with different connections. Would the Date() function (using milliseconds) be the most reliable way to measure time for this purpose? I was thinking of watching the getBytesLoaded() until it reaches a certain value, then determining how long it took to get to that value, then dividing one by the other ( /1024) to get Kps.

If so, how much data should I use for the test to be accurate without taking too much time?

Thanks for the advice -
BooYaKaShaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

XenophonCommented:
Always give the user choice imo... There might be some users on dialup who might prefer the BB connection, and viceversa anyhow...
-X
BooYaKaShaAuthor Commented:
Well, I'm thinking of having the ability to switch manually from a button on the site. But the idea itself....
XenophonCommented:
Yes the idea itself is fine. But use getTimer() rather than the Date() function.

-X

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

BooYaKaShaAuthor Commented:
What do you think, if I measured like 10 or 20K you think that would be accurate enough?
XenophonCommented:
The larger the better of course. The only way to be certain is by testing it. You should also probably take into consideration that the testing swf might be cached, thus providing you with misleading data.

hth
-X
kanaryCommented:
hello BooYaKaSha,

there is a tool in flash called bandwidth profiler that u can run when testing ur movie.

this tool calculates the data loaded in different connections.

u can test ur movie on 14.4, 28.8, 56.6 and more download rates.
this will give u a very nice hint on how much time needed to download ur movie.

then when the client run ur movie. u can calculate the data loaded after 5 seconds for example. if the data loaded compared to the total data that should be loaded is too low ( will lead to wait for example 5 mins to load)  u should transfer the movie to a little bit lower one.

u r the one who should decide how much time the user should wait for the movie to download. the movie downloads in a specific rate. so u can download at any time how much data is loaded and compare it to the total downloaded bytes and then u can know how much time it will take to be completed.

hope this helps,
kanary.

if the
kanaryCommented:
BooYaKaSha,
why didn't u comment on my comment? didn't u get any idea from my posting !!
BooYaKaShaAuthor Commented:
Um, thanks for your comment, but it was not related to what I was talking about.

The bandwidth profilier, aside from not being the most accurate thing in the world, is good for me determining about how long it will take for someone to download my move.

What I am trying to do is test EACH INDIVIDUAL user, in essence figuring out on the fly whether they have dialup or broadband internet, then redirecting them to the appropriate high/low bandwidth versions of my site. You can't do this with Profilier -- its just for testing.

That way I can have a big spiffy version for those with Cable/DSL and a trimmed down version for those with 56k or less. Cool?
BooYaKaShaAuthor Commented:
>> should also probably take into consideration that the testing swf might be cached, thus providing you with misleading data.

Good point. Do you know of a way to force a movie to be re-downloaded instead of using the user's browser cache?
kanaryCommented:
beside the bandwidth profiler that works at design time, i gave u an idea on how to calculate the user download speed at run time.
by comparing how many loaded bytes with the total bytes in a specific time, and this way u can know how much time he will take to download the whole mivie, also u will know his download speed. this way u can forward him to what ever movie u like!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.