<div dir="ltr">What about:<br><br>@@ -316,7 +317,9 @@<br> # use the key created during the initial dispatch phase<br> return $c->_page_cache_key if ( $c->_page_cache_key );<br> <br>- my $key = "/" . $c->req->path;<br>
+ # override key if required<br>+ my $keymaker = $c->config->{page_cache}->{key_maker};<br>+ my $key = $keymaker ? $keymaker($c) : "/" . $c->req->path;<br><br>What else do you need? POD? Tests?<br>
<br><div class="gmail_quote">2008/8/9 Martin Ellison <span dir="ltr"><<a href="mailto:m.e@acm.org">m.e@acm.org</a>></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'm concerned about impacting the performance; this must be high-traffic code. But I'll look into it.<br><br><div class="gmail_quote">2008/8/8 Matt S Trout <span dir="ltr"><<a href="mailto:dbix-class@trout.me.uk" target="_blank">dbix-class@trout.me.uk</a>></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>
> But PageCache only works off $c->request->path() ie not the hostname. This<br>
> behaviour is coded in the _get_page_cache_key() subroutine. This means that<br>
> the PageCache serves up the same page content for all websites, irrespective<br>
> of URL, which is not what I want.<br>
><br>
> It would be nice if there were some way to fix this and keep using<br>
> PageCache, such as overriding _get_page_cache_key(). Does that make sense?<br>
> eg writing a derived class from PageCache?<br>
<br>
</div>How about<br>
<br>
__PACKAGE__->config(<br>
'Plugin::PageCache' => {<br>
key_maker => sub {<br>
my $c = shift;<br>
handwave($c);<br>
}<br>
}<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>
Matt S Trout Need help with your Catalyst or DBIx::Class project?<br>
Technical Director <a href="http://www.shadowcat.co.uk/catalyst/" target="_blank">http://www.shadowcat.co.uk/catalyst/</a><br>
Shadowcat Systems Ltd. Want a managed development or deployment platform?<br>
<a href="http://chainsawblues.vox.com/" target="_blank">http://chainsawblues.vox.com/</a> <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>