Some pointless HTTP header microoptimization.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 25 Nov 2014 17:22:00 +0000 (18:22 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 25 Nov 2014 17:22:00 +0000 (18:22 +0100)
default.vcl
www/serve-analysis.js

index ef0b7d7..e0fbc45 100644 (file)
@@ -24,7 +24,11 @@ sub vcl_recv {
 
 sub vcl_deliver { 
     if (resp.http.x-analysis) {
-        set resp.http.date = now;
+        set resp.http.Date = now;
+        unset resp.http.X-Varnish;
+        unset resp.http.Via;
+        unset resp.http.Age;
+        unset resp.http.X-Powered-By;
     }
     unset resp.http.x-analysis;
 }
index edb4a18..cfc5f15 100644 (file)
@@ -187,10 +187,12 @@ var send_json = function(response, ims, accept_gzip, num_viewers) {
        };
 
        if (accept_gzip) {
+               headers['Content-Length'] = this_json.gzip.length;
                headers['Content-Encoding'] = 'gzip';
                response.writeHead(200, headers);
                response.write(this_json.gzip);
        } else {
+               headers['Content-Length'] = this_json.text.length;
                response.writeHead(200, headers);
                response.write(this_json.text);
        }