Hmm. But if I set tile_source to redraw I will can&#39;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> &lt;<a href="mailto:pspencer@dmsolutions.ca">pspencer@dmsolutions.ca</a>&gt; 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 &quot;BAD THING&quot; (tm).&nbsp;&nbsp;It causes the whole metatile<br>to redraw for every tile request.&nbsp;&nbsp;This is absolutely the worst case<br>performance.<br><br>What you really want to do is use is something like:
<br><br>&quot;tile_source&quot; &quot;redraw&quot;<br>&quot;redraw_interval&quot; &quot;150&quot;<br>&quot;refresh_interval&quot; &quot;300&quot;<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.&nbsp;&nbsp;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.&nbsp;&nbsp;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>&gt; Hi,<br>&gt;<br>&gt; I am having some problems with two layers that use tile_source<br>&gt; &quot;nocache&quot;.<br>
&gt;<br>&gt; I am using it because these layers are respectively points sent by<br>&gt; fishing vessels and areas. These points are sent at 5min intervals<br>&gt; and the areas are inserted by the user. So, *i think* i can&#39;t use
<br>&gt; cache in this case.<br>&gt;<br>&gt; The problem is that the map is taking too much time to load. The<br>&gt; points table in the database have 18.000 registers... and there<br>&gt; will be a lot more. And there is about 18 areas.
<br>&gt;<br>&gt; Also, I am using variable substitution in mapfile. My points layer<br>&gt; is something like that:<br>&gt;<br>&gt; layer<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; name &quot;track&quot;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; group &quot;Track&quot;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; connectiontype POSTGIS
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; connection &quot;dbname=xxx user=xxx password=xxx host=xxx port=5432&quot;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; data &quot;%data%&quot;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; type line<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; status on<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; metadata<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tile_source &quot;nocache&quot;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; class<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name &quot;track&quot;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; color 0 0 0<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&gt; end<br>&gt;<br>&gt;<br>&gt; When the user select some vessel, I do that using javascript:<br>&gt;
<br>&gt; var map = myKaMap.getCurrentMap();<br>&gt; var track = mapa.getLayer(&#39;track&#39;);<br>&gt; track.replacementVariables = {vessel: id_vessel};<br>&gt; track.redraw();<br>&gt;<br>&gt; The areas layer is using the same logic.
<br>&gt;<br>&gt; So, there is a way to achieve that but with better perfomance? The<br>&gt; performance was ok before I add these two layers. Any tips?<br>&gt; _______________________________________________<br>&gt; ka-Map-users mailing list
<br>&gt; <a href="mailto:ka-Map-users@lists.maptools.org">ka-Map-users@lists.maptools.org</a><br>&gt; <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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:pspencer@dmsolutions.ca">pspencer@dmsolutions.ca</a>&nbsp;&nbsp;&nbsp;&nbsp;|<br>+-----------------------------------------------------------------+
<br>|Chief Technology Officer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>|DM Solutions Group Inc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.dmsolutions.ca/">http://www.dmsolutions.ca/</a> |<br>+-----------------------------------------------------------------+
<br><br><br><br><br></blockquote></div><br>