When an inbound connection arrives at a webserver, it could be moving at faster speeds that when it left the client machine to the ISP's gateway.
For that reason, I'd have thought it impossible, but DSLreports, and a few other broadband tests do something similar, but how I'm not sure, could be a good place to start.
I'm guessing that what you want to do is to show different versions of sites based on connection speed, if that's the case, give them a choice at the home page, and meta-refresh after 3 secs to the higher quality page.
But I could be wrong, and it wouldn't be the first time ...
--Paul
cigless ...