about summary refs log tree commit homepage
path: root/examples
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-09-03 08:19:48 +0000
committerEric Wong <e@80x24.org>2015-09-03 08:19:48 +0000
commit83fa9f483121526fceb0a40b715aaf6025b3e7fa (patch)
tree14d641ef249b06535194d02eeb8fd0705bd6a9e7 /examples
parentc65efc9b371f66497549e72418d13c0d8aa3929b (diff)
downloadpublic-inbox-83fa9f483121526fceb0a40b715aaf6025b3e7fa.tar.gz
HTML, text, and probably Atom feeds should be compressed.
Diffstat (limited to 'examples')
-rw-r--r--examples/public-inbox.psgi20
1 files changed, 14 insertions, 6 deletions
diff --git a/examples/public-inbox.psgi b/examples/public-inbox.psgi
index 8eb67eb1..04f3329a 100644
--- a/examples/public-inbox.psgi
+++ b/examples/public-inbox.psgi
@@ -5,9 +5,17 @@
 # Usage: plackup [OPTIONS] /path/to/this/file
 use strict;
 use warnings;
-require PublicInbox::WWW;
-require Plack::Request;
-sub {
-        my $req = Plack::Request->new(@_);
-        PublicInbox::WWW::run($req, $req->method);
-};
+use PublicInbox::WWW;
+PublicInbox::WWW->preload;
+use Plack::Request;
+use Plack::Builder;
+builder {
+        enable "Deflater",
+                content_type => [ 'text/html', 'text/plain',
+                                'application/atom+xml' ];
+        enable "Head";
+        sub {
+                my $req = Plack::Request->new(@_);
+                PublicInbox::WWW::run($req, $req->method);
+        }
+}