Hmm. But if I set tile_source to redraw I will can't use variable substitution, right? Because variable substitution is only implemented in tile_nocache.php<br><br><div><span class="gmail_quote">On 2/5/07, <b class="gmail_sendername">
Paul Spencer</b> <<a href="mailto:pspencer@dmsolutions.ca">pspencer@dmsolutions.ca</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Pje,<br><br>using no-cache is a "BAD THING" (tm). It causes the whole metatile<br>to redraw for every tile request. This is absolutely the worst case<br>performance.<br><br>What you really want to do is use is something like:
<br><br>"tile_source" "redraw"<br>"redraw_interval" "150"<br>"refresh_interval" "300"<br><br>This will cause the client to automatically re-request tiles every<br>
300 seconds (5 minutes) and the tiles will be considered stale and be<br>recreated every 150 seconds (2.5 minutes).<br><br>This allows the tiles to be cached for 2.5 minutes so when a client<br>loads a tile, it only causes one map draw per metatile rather than a
<br>map draw per tile. The tiles are time-stamped and when a request<br>comes in for a tile that is past the time allowed, it redraws the<br>cached tiles. The timestamp is done per-layer so that all the tiles<br>are synchronized.
<br><br>The refresh interval ensures that the layer is dynamically updated<br>even if the user does nothing.<br><br>You can play with the times to get the desired effect and balance<br>your load, but you should find that this produces substantially
<br>better results for you.<br><br>Cheers<br><br>Paul<br><br>On 5-Feb-07, at 7:53 AM, Pje wrote:<br><br>> Hi,<br>><br>> I am having some problems with two layers that use tile_source<br>> "nocache".<br>
><br>> I am using it because these layers are respectively points sent by<br>> fishing vessels and areas. These points are sent at 5min intervals<br>> and the areas are inserted by the user. So, *i think* i can't use
<br>> cache in this case.<br>><br>> The problem is that the map is taking too much time to load. The<br>> points table in the database have 18.000 registers... and there<br>> will be a lot more. And there is about 18 areas.
<br>><br>> Also, I am using variable substitution in mapfile. My points layer<br>> is something like that:<br>><br>> layer<br>> name "track"<br>> group "Track"<br>> connectiontype POSTGIS
<br>> connection "dbname=xxx user=xxx password=xxx host=xxx port=5432"<br>> data "%data%"<br>> type line<br>> status on<br>> metadata<br>> tile_source "nocache"
<br>> end<br>> class<br>> name "track"<br>> color 0 0 0<br>> end<br>> end<br>><br>><br>> When the user select some vessel, I do that using javascript:<br>>
<br>> var map = myKaMap.getCurrentMap();<br>> var track = mapa.getLayer('track');<br>> track.replacementVariables = {vessel: id_vessel};<br>> track.redraw();<br>><br>> The areas layer is using the same logic.
<br>><br>> So, there is a way to achieve that but with better perfomance? The<br>> performance was ok before I add these two layers. Any tips?<br>> _______________________________________________<br>> ka-Map-users mailing list
<br>> <a href="mailto:ka-Map-users@lists.maptools.org">ka-Map-users@lists.maptools.org</a><br>> <a href="http://lists.maptools.org/mailman/listinfo/ka-map-users">http://lists.maptools.org/mailman/listinfo/ka-map-users
</a><br><br>+-----------------------------------------------------------------+<br>|Paul Spencer <a href="mailto:pspencer@dmsolutions.ca">pspencer@dmsolutions.ca</a> |<br>+-----------------------------------------------------------------+
<br>|Chief Technology Officer |<br>|DM Solutions Group Inc <a href="http://www.dmsolutions.ca/">http://www.dmsolutions.ca/</a> |<br>+-----------------------------------------------------------------+
<br><br><br><br><br></blockquote></div><br>