diff --git a/templates/logs.vhost.erb b/templates/logs.vhost.erb index c93ea18..843ca8f 100644 --- a/templates/logs.vhost.erb +++ b/templates/logs.vhost.erb @@ -21,13 +21,27 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %> # use Apache to compress the results afterwards, to save on the wire # it's approx 18x savings of wire traffic to compress. We need to # compress by content types that htmlify can produce - AddOutputFilterByType DEFLATE text/plain text/html + AddOutputFilterByType DEFLATE text/plain text/html application/x-font-ttf ForceType text/html AddDefaultCharset UTF-8 AddEncoding x-gzip gz + + ForceType text/css + AddDefaultCharset UTF-8 + AddEncoding x-gzip gz + + + ForceType text/javascript + AddDefaultCharset UTF-8 + AddEncoding x-gzip gz + + + ForceType application/x-font-ttf + AddEncoding x-gzip gz + # mod_mime_magic is sometimes passing css files as asm sources # e.g css files generated by coverage reports @@ -63,6 +77,12 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %> RewriteEngine On + # If the specified file does not exist, look if there is a gzipped version + # If there is, serve that one instead + RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f + RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}.gz -f + RewriteRule ^/(.*)$ %{REQUEST_URI}.gz + # rewrite txt.gz & console.html[.gz] files to map to our internal htmlify # wsgi app # PT, Pass-through: to come back around and get picked up by the