@@ -1,5 +1,14 @@
Revision history for Plack-Middleware-Precompressed
+1.103 Sat 10 Jan 2015
+ - No functional changes
+ - No longer contains INSTALL file with install-as-root instructions
+
+1.102 Tue 25 Dec 2012
+ - No functional changes.
+ - Cleaned up test suite.
+ - Specified mininmum Perl requirement.
+
1.101 Tue 25 Dec 2012
- Prevent wrapped middlewares from attempting compression when trying
to retrieve a precompressed response.
@@ -1,4 +1,4 @@
-This software is copyright (c) 2011 by Aristotle Pagaltzis.
+This software is copyright (c) 2015 by Aristotle Pagaltzis.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@ b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
-This software is Copyright (c) 2011 by Aristotle Pagaltzis.
+This software is Copyright (c) 2015 by Aristotle Pagaltzis.
This is free software, licensed under:
@@ -272,7 +272,7 @@ That's all there is to it!
--- The Artistic License 1.0 ---
-This software is Copyright (c) 2011 by Aristotle Pagaltzis.
+This software is Copyright (c) 2015 by Aristotle Pagaltzis.
This is free software, licensed under:
@@ -1,3 +1,4 @@
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.030.
Changes
LICENSE
MANIFEST
@@ -7,8 +8,7 @@ Makefile.PL
README
dist.ini
lib/Plack/Middleware/Precompressed.pm
-t/00.load.t
-t/cpants.t
+t/00-compile.t
t/precompressed.t
t/rules.t
t/subclassing.t
@@ -4,7 +4,7 @@
"Aristotle Pagaltzis <pagaltzis@gmx.de>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 4.300023, CPAN::Meta::Converter version 2.120921",
+ "generated_by" : "Dist::Zilla version 5.030, CPAN::Meta::Converter version 2.143240",
"license" : [
"perl_5"
],
@@ -13,15 +13,10 @@
"version" : "2"
},
"name" : "Plack-Middleware-Precompressed",
- "no_index" : {
- "package" : [
- "Plack::Middleware::PrecompressedSubclass"
- ]
- },
"prereqs" : {
"configure" : {
"requires" : {
- "ExtUtils::MakeMaker" : "6.30"
+ "ExtUtils::MakeMaker" : "0"
}
},
"runtime" : {
@@ -33,16 +28,19 @@
"Plack::Util" : "0",
"Plack::Util::Accessor" : "0",
"parent" : "0",
- "strict" : "0"
+ "perl" : "5.006",
+ "strict" : "0",
+ "warnings" : "0"
}
},
"test" : {
"requires" : {
+ "File::Find" : "0",
+ "File::Temp" : "0",
"HTTP::Request::Common" : "0",
"Plack::Builder" : "0",
"Plack::Test" : "0",
- "Test::More" : "0",
- "warnings" : "0"
+ "Test::More" : "0"
}
}
},
@@ -57,6 +55,6 @@
"url" : "git://github.com/ap/Plack-Middleware-Precompressed"
}
},
- "version" : "1.101"
+ "version" : "1.103"
}
@@ -3,23 +3,21 @@ abstract: 'serve pre-gzipped content to compression-enabled clients'
author:
- 'Aristotle Pagaltzis <pagaltzis@gmx.de>'
build_requires:
+ File::Find: 0
+ File::Temp: 0
HTTP::Request::Common: 0
Plack::Builder: 0
Plack::Test: 0
Test::More: 0
- warnings: 0
configure_requires:
- ExtUtils::MakeMaker: 6.30
+ ExtUtils::MakeMaker: 0
dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.300023, CPAN::Meta::Converter version 2.120921'
+generated_by: 'Dist::Zilla version 5.030, CPAN::Meta::Converter version 2.143240'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
name: Plack-Middleware-Precompressed
-no_index:
- package:
- - Plack::Middleware::PrecompressedSubclass
requires:
Array::RefElem: 0
Plack: 0.9942
@@ -28,9 +26,11 @@ requires:
Plack::Util: 0
Plack::Util::Accessor: 0
parent: 0
+ perl: 5.006
strict: 0
+ warnings: 0
resources:
bugtracker: http://github.com/ap/Plack-Middleware-Precompressed/issues
homepage: http://github.com/ap/Plack-Middleware-Precompressed
repository: git://github.com/ap/Plack-Middleware-Precompressed
-version: 1.101
+version: 1.103
@@ -1,29 +1,24 @@
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.030.
use strict;
use warnings;
+use 5.006;
-
-use ExtUtils::MakeMaker 6.30;
+use ExtUtils::MakeMaker;
my %WriteMakefileArgs = (
"ABSTRACT" => "serve pre-gzipped content to compression-enabled clients",
"AUTHOR" => "Aristotle Pagaltzis <pagaltzis\@gmx.de>",
- "BUILD_REQUIRES" => {
- "HTTP::Request::Common" => 0,
- "Plack::Builder" => 0,
- "Plack::Test" => 0,
- "Test::More" => 0,
- "warnings" => 0
- },
"CONFIGURE_REQUIRES" => {
- "ExtUtils::MakeMaker" => "6.30"
+ "ExtUtils::MakeMaker" => 0
},
"DISTNAME" => "Plack-Middleware-Precompressed",
"EXE_FILES" => [],
"LICENSE" => "perl",
+ "MIN_PERL_VERSION" => "5.006",
"NAME" => "Plack::Middleware::Precompressed",
"PREREQ_PM" => {
"Array::RefElem" => 0,
@@ -33,26 +28,48 @@ my %WriteMakefileArgs = (
"Plack::Util" => 0,
"Plack::Util::Accessor" => 0,
"parent" => 0,
- "strict" => 0
+ "strict" => 0,
+ "warnings" => 0
},
- "VERSION" => "1.101",
+ "TEST_REQUIRES" => {
+ "File::Find" => 0,
+ "File::Temp" => 0,
+ "HTTP::Request::Common" => 0,
+ "Plack::Builder" => 0,
+ "Plack::Test" => 0,
+ "Test::More" => 0
+ },
+ "VERSION" => "1.103",
"test" => {
"TESTS" => "t/*.t"
}
);
-unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
- my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
- my $pp = $WriteMakefileArgs{PREREQ_PM};
- for my $mod ( keys %$br ) {
- if ( exists $pp->{$mod} ) {
- $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
- }
- else {
- $pp->{$mod} = $br->{$mod};
- }
- }
+my %FallbackPrereqs = (
+ "Array::RefElem" => 0,
+ "ExtUtils::MakeMaker" => 0,
+ "File::Find" => 0,
+ "File::Temp" => 0,
+ "HTTP::Request::Common" => 0,
+ "Plack" => "0.9942",
+ "Plack::Builder" => 0,
+ "Plack::MIME" => 0,
+ "Plack::Middleware" => 0,
+ "Plack::Test" => 0,
+ "Plack::Util" => 0,
+ "Plack::Util::Accessor" => 0,
+ "Test::More" => 0,
+ "parent" => 0,
+ "strict" => 0,
+ "warnings" => 0
+);
+
+
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
+ delete $WriteMakefileArgs{TEST_REQUIRES};
+ delete $WriteMakefileArgs{BUILD_REQUIRES};
+ $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
@@ -1,13 +1,44 @@
+Plack::Middleware::Precompressed
+Plack::Middleware::Precompressed is an alternative (or rather,
+complement) to middlewares like Deflater, which will compress response
+bodies on the fly. For dynamic resources, that behaviour is necessary,
+but for static resources it is a waste: identical entities will be
+compressed over and over. Instead, *Precompressed* allows you to
+compress static resources once, e.g. as part of your build process, and
+then serve the compressed resource in place of the uncompressed one for
+compression-enabled clients.
-This archive contains the distribution Plack-Middleware-Precompressed,
-version 1.101:
+To do so, by default it appends a ".gz" suffix to the "PATH_INFO" and
+tries to serve that. If that fails, it will then try again with the
+unmodified URI.
- serve pre-gzipped content to compression-enabled clients
+Note: this means requests for resources that are not pre-compressed will
+always be dispatched *twice*. You are are advised to use either the
+"match" parameter or the Conditional middleware or something of the
+sort, to prevent requests from passing through this middleware
+unnecessarily.
-This software is copyright (c) 2011 by Aristotle Pagaltzis.
+INSTALLATION
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
+This is a Perl module distribution. It should be installed with whichever
+tool you use to manage your installation of Perl, e.g. any of
+
+ cpanm .
+ cpan .
+ cpanp -i .
+
+Consult http://www.cpan.org/modules/INSTALL.html for further instruction.
+Should you wish to install this module manually, the procedure is
+ perl Makefile.PL
+ make
+ make test
+ make install
+COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2015 by Aristotle Pagaltzis.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
@@ -1,24 +1,27 @@
name = Plack-Middleware-Precompressed
-version = 1.101
+version = 1.103
author = Aristotle Pagaltzis <pagaltzis@gmx.de>
license = Perl_5
copyright_holder = Aristotle Pagaltzis
-copyright_year = 2011
+copyright_year = 2015
[MetaResources]
homepage = http://github.com/ap/Plack-Middleware-Precompressed
bugtracker = http://github.com/ap/Plack-Middleware-Precompressed/issues
repository = git://github.com/ap/Plack-Middleware-Precompressed
-[MetaNoIndex]
-package = Plack::Middleware::PrecompressedSubclass
-
[Prereqs]
Plack = 0.9942
-[@Basic]
+[@Filter]
+-bundle=@Basic
+-remove=Readme
+[Readme::Brief]
+[ReadmeAnyFromPod / PodInRoot]
[MetaJSON]
[PkgVersion]
[PodWeaver]
[CheckChangeLog]
+[Test::Compile]
[AutoPrereqs]
+[CheckSelfDependency]
@@ -1,12 +1,13 @@
-package Plack::Middleware::Precompressed;
-{
- $Plack::Middleware::Precompressed::VERSION = '1.101';
-}
+use 5.006;
use strict;
-use parent 'Plack::Middleware';
+use warnings;
+package Plack::Middleware::Precompressed;
+$Plack::Middleware::Precompressed::VERSION = '1.103';
# ABSTRACT: serve pre-gzipped content to compression-enabled clients
+use parent 'Plack::Middleware';
+
use Plack::Util::Accessor qw( match rules env_keys );
use Plack::MIME ();
use Plack::Util ();
@@ -27,6 +28,8 @@ sub call {
my $path = $env->{'PATH_INFO'};
my $have_match = $self->match ? $path =~ $self->match : 1;
+ # the `deflate` encoding is unreliably messy so we won't support it
+ # c.f. http://zoompf.com/2012/02/lose-the-wait-http-compression
if ( $have_match ) {
( $encoding ) =
grep { $_ eq 'gzip' or $_ eq 'x-gzip' }
@@ -72,13 +75,15 @@ __END__
=pod
+=encoding UTF-8
+
=head1 NAME
Plack::Middleware::Precompressed - serve pre-gzipped content to compression-enabled clients
=head1 VERSION
-version 1.101
+version 1.103
=head1 SYNOPSIS
@@ -167,7 +172,7 @@ Aristotle Pagaltzis <pagaltzis@gmx.de>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2011 by Aristotle Pagaltzis.
+This software is copyright (c) 2015 by Aristotle Pagaltzis.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -0,0 +1,73 @@
+#!perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+
+
+use File::Find;
+use File::Temp qw{ tempdir };
+
+my @modules;
+find(
+ sub {
+ return if $File::Find::name !~ /\.pm\z/;
+ my $found = $File::Find::name;
+ $found =~ s{^lib/}{};
+ $found =~ s{[/\\]}{::}g;
+ $found =~ s/\.pm$//;
+ # nothing to skip
+ push @modules, $found;
+ },
+ 'lib',
+);
+
+sub _find_scripts {
+ my $dir = shift @_;
+
+ my @found_scripts = ();
+ find(
+ sub {
+ return unless -f;
+ my $found = $File::Find::name;
+ # nothing to skip
+ open my $FH, '<', $_ or do {
+ note( "Unable to open $found in ( $! ), skipping" );
+ return;
+ };
+ my $shebang = <$FH>;
+ return unless $shebang =~ /^#!.*?\bperl\b\s*$/;
+ push @found_scripts, $found;
+ },
+ $dir,
+ );
+
+ return @found_scripts;
+}
+
+my @scripts;
+do { push @scripts, _find_scripts($_) if -d $_ }
+ for qw{ bin script scripts };
+
+my $plan = scalar(@modules) + scalar(@scripts);
+$plan ? (plan tests => $plan) : (plan skip_all => "no tests to run");
+
+{
+ # fake home for cpan-testers
+ # no fake requested ## local $ENV{HOME} = tempdir( CLEANUP => 1 );
+
+ like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" )
+ for sort @modules;
+
+ SKIP: {
+ eval "use Test::Script 1.05; 1;";
+ skip "Test::Script needed to test script compilation", scalar(@scripts) if $@;
+ foreach my $file ( @scripts ) {
+ my $script = $file;
+ $script =~ s!.*/!!;
+ script_compiles( $file, "$script script compiles" );
+ }
+ }
+}
@@ -1,6 +0,0 @@
-use Test::More tests => 1;
-
-BEGIN {
-use_ok( 'Plack::Middleware::Precompressed' )
-or BAIL_OUT( 'testing pointless if the module won\'t even load' );
-}
@@ -1,3 +0,0 @@
-use Test::More skip_all => 'This is just to fob CPANTS';
-eval 'use Test::Pod::Coverage';
-eval 'use Test::Pod';
@@ -1,5 +1,6 @@
use strict;
-no warnings;
+use warnings;
+
use Plack::Test;
use Plack::Builder;
use Test::More;
@@ -1,5 +1,6 @@
use strict;
-no warnings;
+use warnings;
+
use Plack::Test;
use Plack::Builder;
use Test::More;
@@ -1,5 +1,6 @@
use strict;
-no warnings;
+use warnings;
+
use Plack::Test;
use Plack::Builder;
use Test::More;
@@ -25,7 +26,8 @@ test_psgi
done_testing;
BEGIN {
-package Plack::Middleware::PrecompressedSubclass;
+package # hide from PAUSE
+ Plack::Middleware::PrecompressedSubclass;
use parent 'Plack::Middleware::Precompressed';
sub env_keys { \@key }