]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WWW.pm
www: preload: load all encodings at startup
[public-inbox.git] / lib / PublicInbox / WWW.pm
index 56d2c42a41cd8eafd37444e68495644f28a80388..3a428218f783c85849085a1fec549fcaf260adfc 100644 (file)
@@ -125,6 +125,8 @@ sub call {
                get_vcs_object($ctx, $1, $2, $3);
        } elsif ($path_info =~ m!$INBOX_RE/($OID_RE)/s\z!o) {
                r301($ctx, $1, $2, 's/');
+       } elsif ($path_info =~ m!$INBOX_RE/(\w+)\.sql\.gz\z!o) {
+               get_altid_dump($ctx, $1, $2);
        # convenience redirects order matters
        } elsif ($path_info =~ m!$INBOX_RE/([^/]{2,})\z!o) {
                r301($ctx, $1, $2);
@@ -139,6 +141,12 @@ sub call {
 # fragmentation since common allocators favor a large contiguous heap.
 sub preload {
        my ($self) = @_;
+
+       # populate caches used by Encode internally, since emails
+       # may show up with any encoding.
+       require Encode;
+       Encode::find_encoding($_) for Encode->encodings(':all');
+
        require PublicInbox::ExtMsg;
        require PublicInbox::Feed;
        require PublicInbox::View;