unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH 1/3] examples/public-inbox.psgi: update with middlewares
@ 2015-09-03  8:32 Eric Wong
  2015-09-03  8:32 ` [PATCH 2/3] feed: use application/atom+xml for Content-Type Eric Wong
  2015-09-03  8:32 ` [PATCH 3/3] www: move fallback after legacy matches Eric Wong
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2015-09-03  8:32 UTC (permalink / raw)
  To: meta

HTML, text, and probably Atom feeds should be compressed.
---
 examples/public-inbox.psgi | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/examples/public-inbox.psgi b/examples/public-inbox.psgi
index 8eb67eb..04f3329 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);
+	}
+}
-- 
EW


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-03  8:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-03  8:32 [PATCH 1/3] examples/public-inbox.psgi: update with middlewares Eric Wong
2015-09-03  8:32 ` [PATCH 2/3] feed: use application/atom+xml for Content-Type Eric Wong
2015-09-03  8:32 ` [PATCH 3/3] www: move fallback after legacy matches Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).