Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

Any easy way to serve pages based on bandwidth speed?

I got a client who wants to serve a rotating banner of very heavy images (some as much as 326kb) on his homepage. On a fast connection, that's not a problem.

But on a dial-up connection I am right now (overseas, in the middle east), waiting for his homepage to load is a long ordeal. I can't imagine anyone wanting architectural work bad enough to sit thru this: http://leadinc.no/drupal7/ 

The client doesn't want to spend more money and I've done a lot of freebies already.

But even half of America is still dialup - isn't that true? I don't dare to show this site to anyone lest they have dialup and think my work is crap.

Is there some easy-to-setup script to measure client bandwidth (or just measure loading  time) and switch to a pre-determined lighter page?

Site is built on Drupal 7, php, served on apache, linux.
0
polaatx
Asked:
polaatx
1 Solution
 
junipllcCommented:
Wow, this is going to be a creative answer. There are a few ways that I can think of to determine the speed, but they are either not foolproof, or cost money. A couple of options:

1- buy (or find) a database that maps IP addresses to "most likey" connection speeds. In just the short time I researched this question I found prices ranging from $300+ to $700+ -- but if you look hard enough you might be able to find one. An example is this one: http://www.maxmind.com/app/netspeed .

2- put a client-side javascript on the page (preferably jQuery) that blocks on document.ready, performs a small download to determine speed and then invokes the jQuery slider. You'd probably do this as a callback function in jQuery, I think.

3- using the LAMP stack (e.g. using Apache directly) is probably really tricky because you're going to have to have access to all kinds of output buffers...possibly in Apache. I personally haven't hacked that deep into the LAMP stack.....(yet) ;)

4- an initial "quick page" with a spinning "wait" icon where the actual page is just doing a speed test to a server-side PHP script, set a cookie indicating the speed, and then direct to the destination page. you'd only have to do this once for visitors without the cookie set. I see that type of "preloading" style page often (like Google Docs, Gmail, Twitter while loading tweets, etc.)   For an example PHP, check this: http://www.emanueleferonato.com/2006/05/31/determine-connection-speed-with-php/

3- a combo method of the above?

With these you can set a cookie and reference it on sub-pages...if it's necessary.

Totally realized that I dont' know how to count to 5. ;)

Definitely, definitely when you finalize a solution post it here. I'm sure you are not the only person having this issue!

Cheers,

Mike
0
 
polaatxAuthor Commented:
Thank you. I will post if I ever do anything about it.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now