apache config to compress html output if possible
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 27 Apr 2009 23:56:39 +0000 (23:56 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 27 Apr 2009 23:56:39 +0000 (23:56 +0000)
Enable mod-deflate to bring down all pages to under 30kB for clients
accepting gzip compression (which should be most nowadays).  Do not
bother with crappy browsers maladvertising their abilities, since we're
mostly only supporting (modern) standards-compliant behaviour.

Savings in bandwidth and load time are very significant:
digraphs 159522 -> 27734 (17%) - saves nearly 20s on 56k!
vim      107160 -> 13800 (13%)
unicode   64588 ->  8418 (13%)
charset   58682 ->  8269 (14%)
nethack   13428 ->  3396 (25%)
index      1486 ->   828 (56%)

Not compressing stylesheets, because even for base.css this would only
save 8322 bytes, at the risk of browsers being unkind.  Maybe later.

.htaccess

index 24ee14d3f0d0ef874a4838edfa1de4985d6a42ab..bd6e1a7d201b83f8acfc6289b2603357bca73f2f 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -10,3 +10,6 @@ RewriteRule    ^(digraphs)\.ex(/.*)?$ $1.vim$2
 RewriteCond    %{REQUEST_FILENAME}.plp  -f
 RewriteRule    ^/*([^/]+)(.*)           $1.plp$2
 
+# compress html output if accepted by client
+AddOutputFilterByType DEFLATE text/html
+