Thanks for the quickly reply.<br><br>About the options:<br>1) Unfortunately, I can&#39;t.<br><br>2) I tried to modify tile.php and kaMap.js to accept variable substituion. The problem is:<br>- when an user select a vessel in my app and refreshes the map, the code of these vessel is passed to 
tile.php. These code is used to construct the SQL query. The problem is when the user select another vessel and unselect the previous one. The tile is cached and the previous vessel will still be there. I think I can&#39;t use any type of cache in this scenario, because every time a vessel is selected and the user refreshes the map, a new SQL query will be used (in the data section of my layer, 
e.g. data %sql%). So, the cache will be useless.<br><br>3) I am using variable substituion because I can&#39;t have a layer for each vessel (there will be more than 2000 vessels in the system). So, one layer for each is impracticable. Also, these data is dynamic.
<br><br>4) Maybe this is my only option, but I don&#39;t know where to start.<br><br>Sorry about any misunderstanding, english is not my native language.<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;">
right, sorry I missed that detail.&nbsp;&nbsp;The only options you have are:<br><br>1) live with it (not good)<br>2) modify redraw so that it will accept variable substitution - the<br>code is already in the no-cache case so redraw shouldn&#39;t be hard to add
<br>3) change your app so you don&#39;t need to use variable substitution -<br>may not be possible<br>4) fix the no-cache implementation so it doesn&#39;t cause a full<br>metatile draw for every tile<br><br>Cheers<br><br>
Paul<br><br>On 5-Feb-07, at 8:42 AM, Pje wrote:<br><br>&gt; Hmm. But if I set tile_source to redraw I will can&#39;t use variable<br>&gt; substitution, right? Because variable substitution is only<br>&gt; implemented in tile_nocache.php
<br>&gt;<br>&gt; On 2/5/07, Paul Spencer &lt;<a href="mailto:pspencer@dmsolutions.ca">pspencer@dmsolutions.ca</a>&gt; wrote: Pje,<br>&gt;<br>&gt; using no-cache is a &quot;BAD THING&quot; (tm).&nbsp;&nbsp;It causes the whole metatile
<br>&gt; to redraw for every tile request.&nbsp;&nbsp;This is absolutely the worst case<br>&gt; performance.<br>&gt;<br>&gt; What you really want to do is use is something like:<br>&gt;<br>&gt; &quot;tile_source&quot; &quot;redraw&quot;
<br>&gt; &quot;redraw_interval&quot; &quot;150&quot;<br>&gt; &quot;refresh_interval&quot; &quot;300&quot;<br>&gt;<br>&gt; This will cause the client to automatically re-request tiles every<br>&gt; 300 seconds (5 minutes) and the tiles will be considered stale and be
<br>&gt; recreated every 150 seconds (2.5 minutes).<br>&gt;<br>&gt; This allows the tiles to be cached for 2.5 minutes so when a client<br>&gt; loads a tile, it only causes one map draw per metatile rather than a<br>&gt; map draw per tile.&nbsp;&nbsp;The tiles are time-stamped and when a request
<br>&gt; comes in for a tile that is past the time allowed, it redraws the<br>&gt; cached tiles.&nbsp;&nbsp;The timestamp is done per-layer so that all the tiles<br>&gt; are synchronized.<br>&gt;<br>&gt; The refresh interval ensures that the layer is dynamically updated
<br>&gt; even if the user does nothing.<br>&gt;<br>&gt; You can play with the times to get the desired effect and balance<br>&gt; your load, but you should find that this produces substantially<br>&gt; better results for you.
<br>&gt;<br>&gt; Cheers<br>&gt;<br>&gt; Paul<br>&gt;<br>&gt; On 5-Feb-07, at 7:53 AM, Pje wrote:<br>&gt;<br>&gt; &gt; Hi,<br>&gt; &gt;<br>&gt; &gt; I am having some problems with two layers that use tile_source<br>&gt; &gt; &quot;nocache&quot;.
<br>&gt; &gt;<br>&gt; &gt; I am using it because these layers are respectively points sent by<br>&gt; &gt; fishing vessels and areas. These points are sent at 5min intervals<br>&gt; &gt; and the areas are inserted by the user. So, *i think* i can&#39;t use
<br>&gt; &gt; cache in this case.<br>&gt; &gt;<br>&gt; &gt; The problem is that the map is taking too much time to load. The<br>&gt; &gt; points table in the database have 18.000 registers... and there<br>&gt; &gt; will be a lot more. And there is about 18 areas.
<br>&gt; &gt;<br>&gt; &gt; Also, I am using variable substitution in mapfile. My points layer<br>&gt; &gt; is something like that:<br>&gt; &gt;<br>&gt; &gt; layer<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; name &quot;track&quot;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; group &quot;Track&quot;
<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; connectiontype POSTGIS<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; connection &quot;dbname=xxx user=xxx password=xxx host=xxx port=5432&quot;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; data &quot;%data%&quot;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; type line<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; status on
<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; metadata<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tile_source &quot;nocache&quot;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; end<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; class<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name &quot;track&quot;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; color 0 0 0<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; end
<br>&gt; &gt; end<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; When the user select some vessel, I do that using javascript:<br>&gt; &gt;<br>&gt; &gt; var map = myKaMap.getCurrentMap();<br>&gt; &gt; var track = mapa.getLayer(&#39;track&#39;);
<br>&gt; &gt; track.replacementVariables = {vessel: id_vessel};<br>&gt; &gt; track.redraw();<br>&gt; &gt;<br>&gt; &gt; The areas layer is using the same logic.<br>&gt; &gt;<br>&gt; &gt; So, there is a way to achieve that but with better perfomance? The
<br>&gt; &gt; performance was ok before I add these two layers. Any tips?<br>&gt; &gt; _______________________________________________<br>&gt; &gt; ka-Map-users mailing list<br>&gt; &gt; <a href="mailto:ka-Map-users@lists.maptools.org">
ka-Map-users@lists.maptools.org</a><br>&gt; &gt; <a href="http://lists.maptools.org/mailman/listinfo/ka-map-users">http://lists.maptools.org/mailman/listinfo/ka-map-users</a><br>&gt;<br>&gt; +-----------------------------------------------------------------+
<br>&gt; |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>&gt; +-----------------------------------------------------------------+<br>&gt; |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>&gt; |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>&gt; +-----------------------------------------------------------------+<br>&gt;<br>&gt;<br>&gt;<br>
&gt;<br>&gt;<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>