Type: Integer
Returns the visitor’s connection speed throughput in bits per second.
Note: You must call the GetExtPropertiesEx method before checking the value of this property. This property requires the Professional or Enterprise Edition of BrowserHawk.
Tip: See the speed.asp example located in your BrowserHawk directory for detailed information and examples on using this property.
Example:
<% set bhObj = Server.CreateObject("cyScape.browserObj")
bhObj.SetExtProperties "ConnectionSpeed"
bhObj.GetExtPropertiesEx
%>
<html> Your connection speed is: <% = bhObj.ConnectionSpeed %>
</html>
Special notes for this property:
The ConnectionSpeed test is not included when calling GetExtPropertiesEx with the "all" keyword. Therefore you must explicitly pass "ConnectionSpeed" as a parameter to SetExtProperties to check for connection speed.
Connection speed measures the approximate throughput, in bits per second, that the user is connecting to your site at. For example, calling the ConnectionSpeed method may set the ConnectionSpeed property to 24024 for a user with a 28.8 modem. If you do not call the ConnectionSpeed method prior to checking the ConnectionSpeed property, the ConnectionSpeed property will have its default value of -1.
If you just need to distinguish broadband from dial-up users, you should use the Broadband property instead. See Detecting Connection Speed and Dialup Users for more information.
By default the connection speed test uses approximately 25KB of data to perform this test. You can change this data size using the SpeedCheckAdj property.
After testing the connection speed you can use the EstDownloadTimeSec and EstDownloadTimeDesc methods if you wish to display the estimated download time for a particular file to your visitors.
Connection speed detection is designed to detect broadband speeds of approximately T3 and slower. If you test the connection speed using a browser that resides on the same local network as the web server you will likely receive a reading of 0. Likewise if the browser you are testing from resides on the same machine as your web server you will receive a reading of 0. Note that these two conditions mentioned are typical when you are doing development and testing your pages. A reading of 0 typically indicates that the connection is too fast to accurately detect. When testing the parts of your web site that make use of the connection speed we recommend doing so over a connection that is not local (such as a T1, T3, ISDN, DSL, cable modem, dial-up, etc).
The ConnectionSpeed represents the bits per second that the user's connection is providing in terms of throughput. If the user has a 56K modem but is experiencing heavy Internet traffic, either on your site or with their ISP, their actual throughput may be significantly less. Measuring the actual throughput allows you to base what content you wish to send to them based on the speed they are actually getting from their connection, not their ideal maximum.
The accuracy of the connection speed test is weighted more towards the slower speeds than the higher speeds. Expressed another way, the test is designed to better discern the speed differences between a 28.8 modem and a 56K modem / ISDN / DSL, then it is detecting the difference between a T1 and a T3. This is by design. The idea is that as a developer you will be more likely concerned knowing how slow a user's connection is than how fast it is. For example, you may want to handle users at 28.8, 56K, and ISDN / DSL differently, but you're not likely to handle things differently for a T1 user than a T3 user. This approach makes it possible to keep the wait time during the test to a minimum for users with dial-up connections.
A wide variety of conditions can affect the user's throughput, including: heavy traffic on your site, heavy traffic on their ISPs network, and/or heavy Internet traffic in general. In addition, if the user is downloading other files in another browser window while the test is executing, the results may be skewed. This is by design. For example, if a user has a T1 but it is very busy serving other requests, the actual speed they may be receiving over the line may be just a fraction of the total capacity. Since the speed test measures the actual throughput of the connection, you can use this information to your advantage.
Some burstable high-speed technologies, such as cable modems, can have very sporadic connection speeds. For example, in any given minute there may be times where the user is only getting 6K Bytes/sec, and a few seconds later they burst to 600K Bytes/sec. With these technologies it is possible that the speed test will measure their speed at an inopportune time and yield a lower reading then actual.
In general the test provides a measure of +/- 10% of the actual connection throughput. As mentioned above certain intermittent network conditions can cause the test to yield significantly lower results than actual. The test however should not over estimate the line speed by more than the variance of 10% as mentioned above.
The test provides the best results when testing IE and Netscape versions 3 and higher. Some older versions of Opera will run the test once, but if the user loads the page a second time caching issues may cause inaccurate results. You should test the ConnectionSpeed for results greater than 15,000,000 and discount the results. Anything over this value likely indicates the browser did not run the test and just pulled the data from its cache.
Connection speed detection is nearly instantaneous for broadband users, but can take from 4 (56Kbps) to 9 (28.8Kbps) seconds for dial-up users depending on their connection. It can also take longer for dial-up users if you have changed the default testing data file through the SpeedCheckAdj property. During this time you can display a message on the screen or a custom page asking the user to wait while the test is performed. See the optional parameters to the GetExtPropertiesEx method for details.
In general the ConnectionSpeed property should be used as a guide, not as gospel. Results should be fairly consistent when used with the popular browsers, but variances in connection speed can cause variances in the results.
If the user’s JavaScript is disabled this property will not be available and a return value of -1 is used.
You cannot perform a test for ConnectionSpeed and PopupsBlocked from the same script. Doing so will cause invalid speed measurements. If you need to test both connection speed and blocked popups, do so from separate scripts.
See Also: