I have attempted to measure our visitor connection speed by measuring how long it takes to download images on the several main pages. However, I cannot account for 40% of the users and I am hoping that you may have some ideas...
It works something like this
var timeTrackInit=(new Date()).getTime();
<img src=”/images/pic.gif?visitorCookieId=xxxx” onload=”setDLtime( this )”>
setDLtime() function finds the difference between timeTrackInit and the current time, and sends the src and duration of the download to the server. In the image source you may notice visitorCookieId parameter. This insures that the image is not cached if user clears his/her cookies.
Looking at the web logs I can not find any commonality between user agents.
I’m wondering if you have any thoughts on this. For completion, I am including setDLtime function below so you see its implementation. I’ve tested it in windows and Mac on IE 5+, Gecko 1.4+ and was unable in recreating the problem.
iImgStart = imgObj.src.toLowerCase().indexOf( '/images/' );
if ( iImgStart >= 0 )
iImgEnd = imgObj.src.indexOf('?',iImgStart);
if ( iImgEnd < 0 ) iImgEnd=imgObj.src.length;
if ( iImgEnd > iImgStart )
(img=new Image()).src = '/includes/downloaded.asp?src='
+ escape( imgObj.src.substring( iImgStart, iImgEnd ))
+ '&duration=' + ( (new Date() ).getTime()-timeTrackInit );
-Thanks in advance