[Catalyst-commits] r6654 -
trunk/Catalyst-Plugin-PageCache/lib/Catalyst/Plugin
andyg at dev.catalyst.perl.org
andyg at dev.catalyst.perl.org
Mon Aug 13 04:01:32 GMT 2007
Author: andyg
Date: 2007-08-13 04:01:32 +0100 (Mon, 13 Aug 2007)
New Revision: 6654
Modified:
trunk/Catalyst-Plugin-PageCache/lib/Catalyst/Plugin/PageCache.pm
Log:
Remove all leading tabs
Modified: trunk/Catalyst-Plugin-PageCache/lib/Catalyst/Plugin/PageCache.pm
===================================================================
--- trunk/Catalyst-Plugin-PageCache/lib/Catalyst/Plugin/PageCache.pm 2007-08-13 02:22:30 UTC (rev 6653)
+++ trunk/Catalyst-Plugin-PageCache/lib/Catalyst/Plugin/PageCache.pm 2007-08-13 03:01:32 UTC (rev 6654)
@@ -74,10 +74,11 @@
# never serve POST request pages from cache
return $c->NEXT::dispatch(@_) if ( $c->req->method eq "POST" );
- return $c->NEXT::dispatch(@_) if (
- $c->config->{page_cache}->{auto_check_user} &&
- $c->can('user_exists') &&
- $c->user_exists );
+ return $c->NEXT::dispatch(@_) if (
+ $c->config->{page_cache}->{auto_check_user} &&
+ $c->can('user_exists') &&
+ $c->user_exists
+ );
# check the page cache for a cached copy of this page
return $c->NEXT::dispatch(@_)
@@ -192,10 +193,11 @@
# never cache POST requests
return $c->NEXT::finalize(@_) if ( $c->req->method eq "POST" );
- return $c->NEXT::finalize(@_) if (
- $c->config->{page_cache}->{auto_check_user} &&
- $c->can('user_exists') &&
- $c->user_exists );
+ return $c->NEXT::finalize(@_) if (
+ $c->config->{page_cache}->{auto_check_user} &&
+ $c->can('user_exists') &&
+ $c->user_exists
+ );
return $c->NEXT::finalize(@_) if ( scalar @{ $c->error } );
# if we already served the current request from cache, we can skip the
@@ -205,10 +207,11 @@
if ( !$c->_cache_page && scalar @{ $c->config->{page_cache}->{auto_cache} } ) {
# is this page part of the auto_cache list?
my $path = "/" . $c->req->path;
- # For performance, this should be moved to setup, and generate a hash.
+
+ # For performance, this should be moved to setup, and generate a hash.
AUTO_CACHE:
foreach my $auto ( @{ $c->config->{page_cache}->{auto_cache} } ) {
- next if $auto =~ m/^\d$/;
+ next if $auto =~ m/^\d$/;
if ( $path =~ /^$auto$/ ) {
$c->log->debug( "Auto-caching page $path" )
if ( $c->config->{page_cache}->{debug} );
@@ -274,13 +277,13 @@
# detect the cache plugin being used and set appropriate
# never-expires syntax
if ( $c->can('cache') ) {
-
+
# Newer C::P::Cache, cannot call $c->cache as a package method
if ( $c->isa('Catalyst::Plugin::Cache') ) {
return;
}
-
- # Older Cache plugins
+
+ # Older Cache plugins
if ( $c->cache->isa('Cache::FileCache') ) {
$c->config->{page_cache}->{no_expire} = "never";
}
@@ -298,13 +301,13 @@
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;
-
+
# prepend language if I18N present.
if ( $c->can('language') ) {
$key = ':' . $c->language . ':' . $key;
More information about the Catalyst-commits
mailing list