If you're really worried about people leaving right away if the first page load is slow, I guess you'd have to make your default assumption that their connection is slow and people will hit the slow version of the site first. If you think people would be willing to wait for the first load, I'd suggest loading the fast-connection version first.
You could put some javascript in your tag--pretty much before you load anything else--that looks something like this:
If you use jQuery or something, you can clean that up a bit, but I didn't want to assume.
This looks for an existing "connection" cookie or defaults to "fast" and then adds that variable (+ 'Connection') as a class on your tag.
It also fires off a couple setTimeouts and tells the browser to cancel those timeouts when the page finishes loading.
If the page takes too long to load, one or both of the setTimeouts will fire and set the connect varialbe to 'medium' or 'slow' and store the variable in a cookie for the next page load.
You might have to play with the timeout delays depending on the size of you page and the variance of your customers' page load times.
With the classname, the js variable and the cookie, you now have a lot of options.
Your stylesheets can key off the class on your html tag and load lower quality images for slower connections.
The js variable allows you to optionally do some lazy loading of content or just pull stuff in right away for faster connections.
You can read the cookie on the back-end and redirect them to speed-specific versions of pages.
Hope that helps.