<?xml version="1.0" encoding="windows-1252"?>
<node id="612010" title="Re^4: Speeding up Apache RewriteMap script." created="2007-04-25 09:42:48" updated="2007-04-25 05:42:48">
<type id="11">
note</type>
<author id="79379">
graq</author>
<data>
<field name="doctext">
&lt;p&gt;Apologies for not being clear.&lt;/p&gt;

&lt;p&gt;Apache opens the script and holds it open for its lifetime. &lt;c&gt;RewriteMap&lt;/c&gt; writes to it (hence the &lt;c&gt;while(&lt;STDIN&gt;){..}&lt;/c&gt; loop) and waits for output from STDOUT.&lt;/p&gt;

&lt;p&gt;For every such mapping (read: every http request), the &lt;c&gt;lookup&lt;/c&gt; method is called. I assumed that that is where the main speed up could be attained.&lt;/p&gt;

&lt;p&gt;Although I'm not sure how moot this is with [merlyn]'s [611988|reply] in play&lt;/p&gt;
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-79379"&gt;
&lt;p&gt;-=( &lt;a href="http://www.graq.co.uk"&gt;Graq&lt;/a&gt; )=-
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
611968</field>
<field name="parent_node">
612001</field>
</data>
</node>
