<div dir="ltr">What about:<br><br>@@ -316,7 +317,9 @@<br>&nbsp;&nbsp;&nbsp;&nbsp; # use the key created during the initial dispatch phase<br>&nbsp;&nbsp;&nbsp;&nbsp; return $c-&gt;_page_cache_key if ( $c-&gt;_page_cache_key );<br>&nbsp;<br>-&nbsp;&nbsp;&nbsp; my $key = &quot;/&quot; . $c-&gt;req-&gt;path;<br>
+&nbsp;&nbsp;&nbsp; # override key if required<br>+&nbsp;&nbsp;&nbsp; my $keymaker = $c-&gt;config-&gt;{page_cache}-&gt;{key_maker};<br>+&nbsp;&nbsp;&nbsp; my $key = $keymaker ? $keymaker($c) : &quot;/&quot; . $c-&gt;req-&gt;path;<br><br>What else do you need? POD? Tests?<br>
<br><div class="gmail_quote">2008/8/9 Martin Ellison <span dir="ltr">&lt;<a href="mailto:m.e@acm.org">m.e@acm.org</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">I&#39;m concerned about impacting the performance; this must be high-traffic code. But I&#39;ll look into it.<br><br><div class="gmail_quote">2008/8/8 Matt S Trout <span dir="ltr">&lt;<a href="mailto:dbix-class@trout.me.uk" target="_blank">dbix-class@trout.me.uk</a>&gt;</span><div>
<div></div><div class="Wj3C7c"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>On Fri, Aug 08, 2008 at 05:08:02PM +0800, Martin Ellison wrote:<br>
&gt; But PageCache only works off $c-&gt;request-&gt;path() ie not the hostname. This<br>
&gt; behaviour is coded in the _get_page_cache_key() subroutine. This means that<br>
&gt; the PageCache serves up the same page content for all websites, irrespective<br>
&gt; of URL, which is not what I want.<br>
&gt;<br>
&gt; It would be nice if there were some way to fix this and keep using<br>
&gt; PageCache, such as overriding _get_page_cache_key(). Does that make sense?<br>
&gt; eg writing a derived class from PageCache?<br>
<br>
</div>How about<br>
<br>
__PACKAGE__-&gt;config(<br>
 &nbsp;&#39;Plugin::PageCache&#39; =&gt; {<br>
 &nbsp; &nbsp;key_maker =&gt; sub {<br>
 &nbsp; &nbsp; &nbsp;my $c = shift;<br>
 &nbsp; &nbsp; &nbsp;handwave($c);<br>
 &nbsp; &nbsp;}<br>
 &nbsp;}<br>
);<br>
<br>
and making the current implementation the default in the absence thereof?<br>
<br>
Fancy having a play with doing a patch?<br>
<br>
--<br>
 &nbsp; &nbsp; &nbsp;Matt S Trout &nbsp; &nbsp; &nbsp; Need help with your Catalyst or DBIx::Class project?<br>
 &nbsp; Technical Director &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.shadowcat.co.uk/catalyst/" target="_blank">http://www.shadowcat.co.uk/catalyst/</a><br>
&nbsp;Shadowcat Systems Ltd. &nbsp;Want a managed development or deployment platform?<br>
<a href="http://chainsawblues.vox.com/" target="_blank">http://chainsawblues.vox.com/</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.shadowcat.co.uk/servers/" target="_blank">http://www.shadowcat.co.uk/servers/</a><br>
<br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk" target="_blank">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
</blockquote></div></div></div><br><br clear="all"><div class="Ih2E3d"><br>-- <br>Regards,<br>Martin<br>(<a href="mailto:m.e@acm.org" target="_blank">m.e@acm.org</a>)<br>IT: <a href="http://methodsupport.com" target="_blank">http://methodsupport.com</a> Personal: <a href="http://thereisnoend.org" target="_blank">http://thereisnoend.org</a><br>


</div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Martin<br>(<a href="mailto:m.e@acm.org">m.e@acm.org</a>)<br>IT: <a href="http://methodsupport.com">http://methodsupport.com</a> Personal: <a href="http://thereisnoend.org">http://thereisnoend.org</a><br>

</div>