x

Re: Worldwide routable Garmin maps: URL REMOVED


Geschrieben von Lambertus (Gast) am 02. Februar 2010 17:43:33: [flux]

Als Antwort auf: Worldwide routable Garmin maps: URL REMOVED geschrieben von Lambertus (Gast) am 08. März 2009 14:41:

Hahaha, I thought that I massively improved the loading time of the tile definitions because I rewrote the OpenLayers section in the webpage scripts that loads the KML file with the tile definitions....

Well think again, it turns out that disabling gzip output in the server side script did the trick all by itself. The strange thing is: the AJAX call is downloading the data immediately and the processing of the zipped data also seems to be immediate (according to a spike in CPU and bandwidth usage), however the result is only shown about 12-13 seconds later... mystery.

Compression is handled by adding the following two lines to the server side PHP scripts:

ob_start("ob_gzhandler");
[my␣functional␣code]
ob_flush();

I'll see if there are other, better, ways of doing compression...

Edit1: When I let the compression be handled by the webserver (controlled through .htaccess) then it works fast as expected. Investigating further....

Edit2: This seems like a browser issue. FF 3.5.5, 3.5.7, 3.6 and IE 8 are slow in displaying the tiles from a zipped source, but webkit is very fast. Thanks to crschmidt for the pointer.

Edit3: Problem solved, the error originated from this side of the monitor ofcourse: The PHP script that returns the gzipped KML content also returned the content-length header set to the size of the source KML file instead of the gzipped size... So as a result the browser is expecting more data and is waiting for it until a timeout occurs. Duh.

Well, the KML output script is fixed now and facilitates browsers that support compressed content as well as those browsers that do not.