[ka-Map-users] Speeding up tile display/download
Joe Franklin
traderboy at yahoo.com
Mon Feb 19 08:57:29 EST 2007
if you don't have access to your DNS server, you can set up 4 static DNS hosts to point to your server on dyndns.com. it's free. then use the method Ionut suggests.
I believe the issue is that the web browser will only start a few threads for requests from a single server at a time. so you are basically fooling the browser into opening 4x the number of threads to request data from your server. makes a big performance difference.
joe
----- Original Message ----
From: Ionut Muntean <ionut at muntean.ro>
To: ka-map-users at lists.maptools.org
Sent: Saturday, February 17, 2007 2:00:46 PM
Subject: [ka-Map-users] Speeding up tile display/download
Hi,
Don't know if this is already known by you, but it is worth a try to
share this.
I've always wondered why google maps displays the tiles so fast.
mt0..mt3.google.com resolves to the same server. So what's the clue?
Fortunately, i've bumped on some web page where it says that IE and
Firefox have only 4 sockets for downloading the web page content.
So, what if altering kaMap.setTile() to use, sequentially, 4 server
names to build img.src?
The improvement was dramatically! The tiles are now loading 4 to 5 times
faster.
tileURL is now an array that holds 4 server names that are basically
only cnames in the dns server to the same server.
The setTile() function was modified to sequential build the img.src like
this (this is only the last part of the function):
.....
var idx = this._map.kaMap.tileIDX;
if (this._map.kaMap.tileURL[idx].indexOf('?') != -1) {
if (this._map.kaMap.tileURL[idx].slice(-1) != '&') {
q = '&';
} else {
q = '';
}
} else {
var src = this._map.kaMap.tileURL[idx] +
q + 'map=' + this._map.name +
'&t=' + t +
'&l=' + l +
szScale + szForce + szGroup + szImageformat + szTimestamp +
szVersion;
}
if (img.src != src) {
img.style.visibility = 'hidden';
img.src = src;
}
idx++;
if (idx == this._map.kaMap.tileURL.length) {
this._map.kaMap.tileIDX = 0;
} else {
this._map.kaMap.tileIDX = idx;
}
}
Of course this method presumes that you have access to the DNS servers
of the company or whoever is hosting your pages.
Hope this is usefull info for someone.
/ IM
_______________________________________________
ka-Map-users mailing list
ka-Map-users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/ka-map-users
____________________________________________________________________________________
Any questions? Get answers on any topic at www.Answers.yahoo.com. Try it now.
More information about the ka-Map-users
mailing list