Plack-Middleware-Deflater
view release on metacpan or search on metacpan
cpanfile
dist.ini
lib/Plack/Middleware/Deflater.pm
t/00_compile.t
t/author-pod-syntax.t
t/content_type.t
t/deflater.t
t/delayed.t
t/furl.t
t/no-clobber.t
t/streaming.t
t/vary.t
t/xno-compress.t
t/xskip-deflater.t
xt/perlcritic.t
xt/perlcriticrc
xt/pod.t
xt/synopsis.t
t/delayed.t view on Meta::CPAN
sub {
my $env = shift;
$env->{HTTP_ACCEPT_ENCODING} =~ s/(gzip|deflate)//gi
if $env->{HTTP_USER_AGENT} =~ m!^Mozilla/4!
and $env->{HTTP_USER_AGENT} !~ m!\bMSIE\s(7|8)!;
$cb->($env);
}
};
enable 'Deflater', content_type => 'text/plain', vary_user_agent => 1;
# Non streaming
# sub { [200, [ 'Content-Type' => 'text/plain' ], [ "Hello World" ]] }
# delayed
sub {
my $env = shift;
return sub {
my $r = shift;
$r->([ '200', [ 'Content-Type' => 'text/plain' ], ["Hello World"]]);
};
};
t/streaming.t view on Meta::CPAN
sub {
my $env = shift;
$env->{HTTP_ACCEPT_ENCODING} =~ s/(gzip|deflate)//gi
if $env->{HTTP_USER_AGENT} =~ m!^Mozilla/4!
and $env->{HTTP_USER_AGENT} !~ m!\bMSIE\s(7|8)!;
$cb->($env);
}
};
enable 'Deflater', content_type => 'text/plain', vary_user_agent => 1;
# Non streaming
# sub { [200, [ 'Content-Type' => 'text/plain' ], [ "Hello World" ]] }
# streaming
sub {
my $env = shift;
return sub {
my $r = shift;
my $w = $r->([ '200', [ 'Content-Type' => 'text/plain' ]]);
my $timer;
my $i = 0;
my @message = qw/Hello World/;
$timer = AnyEvent->timer(
after => 1,
( run in 0.349 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )