roxen.lists.roxen.general

Subject Author Date
Another fix (Re: [PATCH 14/17] New module: gzip-on-the-fly) Stephen R. van den Berg <srb[at]cuci[dot]nl> 30-01-2009
The proper Content-Type has already been determined (and might have
been overridden by RXML), by using the file->type you are sometimes
using stale information (i.e. in my CMS system that resulted in all
files being tried for compression).

Also, it might be interesting to note that as of now I'm running with
compression turned on in a production environment hosting over 200 virtual
hosts with a database filesystem as a backend.

commit 1bd7a53efb07213752eae4ad5250e17660d2fb6e
Author: Stephen R. van den Berg <<srb[at]cuci.nl>>
Date:   Fri Jan 30 10:44:55 2009 +0100

    Take the proper Content-Type field already determined

diff --git a/server/protocols/http.pike b/server/protocols/http.pike
index 21b0aea..0678664 100644
--- a/server/protocols/http.pike
+++ b/server/protocols/http.pike
@@ -2289,7 +2289,8 @@ void send_result(mapping|void result)
           string compressed;
 	  string encoding;
           if(!file->encoding) {
-            if(compressed = try_gzip_data(data, file->type)) {
+            if(compressed =
+	     try_gzip_data(data, variant_heads["Content-Type"])) {
               data = compressed;
               file->encoding = encoding = "gzip";
             }
-- 
Sincerely,
           Stephen R. van den Berg.
"Papers in string theory are published at a rate above the speed of light.
 This is no problem since no information is being transmitted." -- H. Kleinert