Branch Coverage

blib/lib/Catalyst/Plugin/PageCache.pm
Criterion Covered Total %
branch 89 136 65.4


line true false branch
28 21 7 if (@args == 1) { }
32 0 21 if ref $expires and $expires->can('epoch')
48 0 2 unless $c->can('cache')
54 0 2 unless (my $index_page_key = $pc_config->{'index_page_key'})
67 0 2 unless $index_key =~ /^ $uri (?:\#.*)? $/x
75 0 2 if $is_debug
79 2 0 if $removed
95 13 13 if ($options->{'cache_seconds'} and $options->{'cache_seconds'} > 0) { }
96 0 13 if $is_debug
106 0 13 if $is_debug
120 0 48 unless $c->req->method =~ /^(?:GET|HEAD)$/
126 4 44 $hook_name ? :
127 2 46 if $hook and not $c->$hook
131 0 0 if $pc_config->{'auto_check_user'} and $c->can('user_exists') and $c->user_exists
135 0 46 unless my $key = $c->_get_page_cache_key
140 28 18 unless my $data = $cache->get($key)
145 3 15 if ($data->{'expire_time'} and $data->{'expire_time'} <= time)
146 1 2 if (my $busy_lock = $pc_config->{'busy_lock'}) { }
154 0 1 if $pc_config->{'debug'}
158 0 2 if $pc_config->{'debug'}
162 2 0 if (my $index_page_key = $pc_config->{'index_page_key'})
166 2 0 if $found
176 0 15 if $pc_config->{'debug'}
181 0 15 if $c->_page_cache_not_modified($data)
188 15 0 if $data->{'content_type'}
191 0 15 if $data->{'content_encoding'}
206 0 41 if ($c->req->headers->if_modified_since)
208 0 0 if ($c->req->headers->if_modified_since == $data->{'create_time'})
227 4 37 if ($pc_config->{'cache_headers'})
228 0 4 unless $data->{'headers'}
235 31 10 unless $pc_config->{'set_http_headers'}
237 6 4 if (exists $data->{'expires'}) { }
240 4 2 unless ($data->{'expires'})
261 6 0 unless $c->res->status and $c->res->status == 304
268 0 48 if $c->req->method eq 'POST'
273 4 44 $hook_name ? :
274 2 46 if $hook and not $c->$hook
278 0 0 if $pc_config->{'auto_check_user'} and $c->can('user_exists') and $c->user_exists
280 0 46 if scalar @{$c->error;}
284 15 31 if $c->_page_cache_used
286 2 5 if (not $c->_cache_page and scalar @{$pc_config->{'auto_cache'};})
297 0 3 if $auto =~ /^\d$/
298 2 1 if ($path =~ /^$auto$/)
300 0 2 if $pc_config->{'debug'}
307 26 5 if ($c->_cache_page)
311 26 0 if $data
339 0 26 if $data->{'expire_time'} <= $now
343 0 26 if $pc_config->{'debug'}
345 2 24 if ($pc_config->{'cache_headers'})
351 26 0 if ($pc_config->{'index_page_key'})
357 5 21 if $c->req->uri->query
361 3 23 if (exists $options->{'expires'})
371 26 0 if ($data->{'index_key'})
390 0 11 if ($c->config->{'page_cache'} and not $c->config->{'Plugin::PageCache'})
406 11 0 unless defined $pc_config->{'index_page_key'}
408 0 11 unless (defined $pc_config->{'disable_index'})
413 0 11 if $pc_config->{'disable_index'}
417 11 0 if ($c->can('cache')) { }
420 11 0 if ($c->isa('Catalyst::Plugin::Cache'))
427 0 0 if ($cache->isa('Cache::FileCache')) { }
0 0 elsif ($cache->isa('Cache::Memcached') or $cache->isa('Cache::FastMmap')) { }
450 29 46 if $c->_page_cache_key
454 4 42 $keymaker ? :
457 0 46 if ($c->can('language'))
465 1 45 if (length $key > 100)
475 5 41 if (%$parameters) { }
1 40 elsif (my $query = $c->req->uri->query) { }
484 6 40 if $params_key