line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
572
|
use 5.008001; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
2
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
46
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Plack::Middleware::NeverExpire; |
6
|
|
|
|
|
|
|
$Plack::Middleware::NeverExpire::VERSION = '1.006'; |
7
|
|
|
|
|
|
|
# ABSTRACT: set expiration headers far in the future |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
3
|
use parent 'Plack::Middleware'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
54
|
use Plack::Util (); |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
12
|
|
12
|
1
|
|
|
1
|
|
504
|
use Time::Piece (); |
|
1
|
|
|
|
|
8591
|
|
|
1
|
|
|
|
|
24
|
|
13
|
1
|
|
|
1
|
|
6
|
use Time::Seconds (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
134
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub call { |
16
|
1
|
|
|
1
|
1
|
16780
|
my $self = shift; |
17
|
|
|
|
|
|
|
Plack::Util::response_cb( $self->app->( shift ), sub { |
18
|
1
|
|
|
1
|
|
94
|
my $res = shift; |
19
|
1
|
50
|
|
|
|
4
|
return if $res->[0] != 200; |
20
|
1
|
|
|
|
|
11
|
my $date = Time::Piece->gmtime( time + Time::Seconds::ONE_YEAR ); |
21
|
1
|
|
|
|
|
53
|
Plack::Util::header_set( $res->[1], 'Expires', $date->strftime ); |
22
|
1
|
|
|
|
|
135
|
Plack::Util::header_push( $res->[1], 'Cache-Control', 'max-age=' . Time::Seconds::ONE_YEAR . ', public' ); |
23
|
1
|
|
|
|
|
12
|
return; |
24
|
1
|
|
|
|
|
9
|
} ); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |