Type: Integer
Returns the visitor’s download connection speed throughput in bits per second. For upload speed see the UploadConnectionSpeed property.
Important: You can choose either the "Progressive" or "Original" method of testing the connection speed. The Progressive method is recommended, but requires some basic setup before first time use and may result in increased fees from your hosting provider due to the bandwidth the test uses. Therefore the Original method of testing is the default. See Progressive Versus Original Speed Tests for more information.
Note: Use of this property requires the Professional or Enterprise Edition of BrowserHawk.
Note: If you want to use the Progressive method of testing, you must set the SpeedCheckType property to indicate you wish to use the Progressive testing method, set the SupportFilesRoot property as required by the Progressive testing method, copy the speed test image files to your server as explained in the Progressive testing section, and call the GetExtendedBrowser method before checking the value of this property.
Tip: See the speed.aspx for a working example of the connection speed test using the Progressive method, or the speed-orig.aspx for the Original method.
C# Example:
<%
ExtendedOptions options = new ExtendedOptions();
options.AddProperties("ConnectionSpeed");
options.PageMessage = "Please wait while your connection speed is tested…";
// The following comments apply only if performing a Progressive speed check (defaults to "Original" speed check)
// (Progressive method is recommended for best accuracy and testing control):
// Note that image files are required to be placed on your website prior to use. See Progressive Speed Check topic.
// options.SpeedCheckType = ExtendedOptions.SPEED_CHECK_TYPE_PROGRESSIVE;
// options.SupportFilesRoot = "url where you placed speed test image files";
ExtendedBrowserObj extBrow = BrowserObj.GetExtendedBrowser(options);
%>
<html>
Your download connection speed in bits per second is: <% Response.Write(extBrow.ConnectionSpeed); %> <br>
Your download connection speed for nicely formatted display purposes is: <% Response.Write(extBrow.Translate("ConnectionSpeed")); %> <p>
</html>
Special notes for this property:
You can choose between the "Progressive" (recommended) and "Original" (default) methods for testing connection speeds. Note that the Progressive method may increase your web hosting fees due to increased bandwidth usage. See Progressive Versus Original Speed Tests for more information and tips on reducing this bandwidth.
The ConnectionSpeed test is not included when calling AddProperties with the "all" keyword. Therefore you must explicitly pass "ConnectionSpeed" as a parameter to GetExtendedBrowser or AddProperties to check for connection speed.
Connection speed measures the approximate throughput, in bits per second, that the user is connecting to your site at. If you do not call the GetExtendedBrowser method prior to checking the ConnectionSpeed property, the ConnectionSpeed property returns -2.
In the event the ConnectionSpeed test times out (as determined by SpeedCheckMaxWait) or an error occurs during testing, the ConnectionSpeed and ConnectionLatency properties return -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. Several properties are available to control the data sizes and timings when using the Progressive method.
After testing the connection speed you can use the GetDownloadTimeSec and GetDownloadTimeDesc methods if you wish to display the estimated download time for a particular file to your visitors.
Applies to Progressive testing method only: When testing over a local network (browser and web server residing on a local network) you can expect speed measurements to be very high - even hundreds of Mbps. This is normal. Results for real site visitors connecting over the internet will be as expected.
Applies to Original testing method only: 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 fast connection 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.
Applies to Original testing method only: 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 slower connections than the difference between higher speed connections. This approach makes it possible to keep the wait time during the test to a minimum for users with dial-up connections. The Progressive speed test is weighted equally and yields the best results since the size of the data used for the test is dynamically selected based on the test.
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.
Applies to Original testing method only: 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 a small portion of their capacity, and a few seconds later they burst toward full capacity. 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.
Connection speed detection takes a few seconds to perform. 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 GetExtendedBrowser 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. This applies more so to testing with the Original method.
If the user’s JavaScript is disabled this property will not be available and a value of -2 is returned.
You cannot perform a test for ConnectionSpeed using the Original testing method 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 or use the Progressive testing method.
See Also:
ConnectionLatency Property (.NET)
Detecting Connection Speed and Dialup Users