| 1 | package Catalyst::ActionRole::NotCacheableHeaders; | ||||||||||
| 2 | 3 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 3 | $Catalyst::ActionRole::NotCacheableHeaders::VERSION = '0.02'; | |||||||||
| 4 | } | ||||||||||
| 5 | # ABSTRACT: Set no cache headers for actions | ||||||||||
| 6 | |||||||||||
| 7 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 3 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 3 | ▶ | use HTTP::Date qw(time2str); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 5 | ▶ | after 'execute' => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 12 | 5 | my $self = shift; | |||||||||
| 13 | 5 | my ($controller, $c, @args) = @_; | |||||||||
| 14 | |||||||||||
| 15 | 5 | ▶ | if ( exists $c->action->attributes->{NotCacheable} ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 4 | $c->response->header( | |||||||||
| 17 | 'Expires' => 'Thu, 01 Jan 1970 00:00:00 GMT', | ||||||||||
| 18 | 'Pragma' => 'no-cache', | ||||||||||
| 19 | 'Cache-Control' => 'no-cache', | ||||||||||
| 20 | 'Last-Modified' => time2str( time ), | ||||||||||
| 21 | ); | ||||||||||
| 22 | } | ||||||||||
| 23 | 3 | }; | |||||||||
| 24 | |||||||||||
| 25 | 3 | ▶ | no Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 26 | |||||||||||
| 27 | 3 | 1; # End of Catalyst::ActionRole::NotCacheableHeaders | |||||||||
| 28 | |||||||||||
| 29 | |||||||||||
| 30 | |||||||||||
| 31 | __END__ | ||||||||||