I am resubmitting this patch *again*, could someone please look at it. -- Regards, Martin ([EMAIL PROTECTED]) IT: http://methodsupport.com Personal: http://thereisnoend.org
14keymaker.t
Description: Troff document
Index: PageCache.pm
===================================================================
@@ -311,13 +313,15 @@
sub _get_page_cache_key {
my $c = shift;
-
+
# We can't rely on the params after the user's code has run, so
# use the key created during the initial dispatch phase
return $c->_page_cache_key if ( $c->_page_cache_key );
- my $key = "/" . $c->req->path;
-
+ # override key if required
+ my $keymaker = $c->config->{page_cache}->{key_maker};
+ my $key = $keymaker ? $keymaker->($c) : "/" . $c->req->path;
+
# prepend language if I18N present.
if ( $c->can('language') ) {
$key = ':' . $c->language . ':' . $key;
@@ -479,6 +483,17 @@
Note that this is called BEFORE auto_check_user, so you have more flexibility
to determine what to do for not logged in users.
+To override the generation of page keys:
+
+__PACKAGE__->config(
+ page_cache => {
+ key_maker => sub {
+ my ($c) = @_;
+ return $c->req->base . '/' . $c->req->path;
+ }
+ }
+);
+
=head1 METHODS
=head2 cache_page
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
