Any easy way to serve pages based on bandwidth speed?

Posted on 2011-10-21
Last Modified: 2012-05-12
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:  

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.
Question by:polaatx
    LVL 12

    Accepted Solution

    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: .

    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:

    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!



    Author Comment

    Thank you. I will post if I ever do anything about it.

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
    HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now