问题
I write web based applications. Performance is obviously a key factor. Whilst database load and page rendering time are things I have control of, the users internet connection is not.
What I'm looking for is a way to indicate what sort of a connection a user has. Something along the lines of a traffic light in the corner of a website that shows the user what sort of a connection they have to the site and therefore indicating what sort of perceived performance they should expect. e.g. Maybe the app just seems slow because everyone else in your company is browsing facebook on their lunch hour.
My initial thoughts are that this could be achieved by some javascript that runs on each page load.
Ideally the code is very "dropable" and does not require major code or infrastructure changes to implement.
回答1:
This seems like something you could use. You could also time an AJAX request; how long is the round trip? You'll probably have to establish some benchmarks on your own.
来源:https://stackoverflow.com/questions/465314/simple-bandwidth-latency-test-to-estimate-a-users-experience