Last modified: 2014-10-17 05:11:55 UTC
Right now the tools.wmflabs.org proxy and/or the lighttpd default configuration are gzipping: * static html * static js: https://tools.wmflabs.org/intuition/main.js * static css https://tools.wmflabs.org/intuition/main.css * fcgi-php generated html https://tools.wmflabs.org/intuition/index.php But not * fcgi-php generated js https://tools.wmflabs.org/intuition/load.php?env=mw I tried adding compress.file-types = ( "text/javascript" ) or compress.file-types = ( "text/javascript; charset=utf-8" ) but made no difference. I'd understand if fcgi responses are not covered by mod_compress by lighttpd. But then was is doing the gzip compression for the index.php response? I thought it was the dynamicproxy instance, but that actually had its text/html gzip entry removed as of https://gerrit.wikimedia.org/r/#/c/133265/. So 1) What is adding gzip for text/html PHP responses? 2) How can I get it on text/javascript PHP responses? See also: * Default lighttpd config https://github.com/wikimedia/operations-puppet/blob/b7b047918/modules/toollabs/files/lighttpd-starter#L42-L110 * Nginx config (proxy) https://github.com/wikimedia/operations-puppet/blob/b77cc66ec/modules/dynamicproxy/templates/domainproxy.conf
Externally: $ curl --compress -I 'http://tools.wmflabs.org/intuition/index.php' HTTP/1.1 200 OK Server: nginx/1.5.0 Content-Type: text/html; charset=utf-8 X-Powered-By: PHP/5.3.10-1ubuntu3.14+wmf1 Content-Encoding: gzip $ curl --compress -I 'http://tools.wmflabs.org/intuition/load.php?env=mw' HTTP/1.1 200 OK Server: nginx/1.5.0 Content-Type: text/javascript; charset=utf-8 X-Powered-By: PHP/5.3.10-1ubuntu3.14+wmf1 Hitting nginx directly from bastion: $ curl --compress -I 'http://tools-webproxy.eqiad.wmflabs/intuition/index.php' HTTP/1.1 200 OK Server: nginx/1.5.0 Content-Type: text/html; charset=utf-8 X-Powered-By: PHP/5.3.10-1ubuntu3.14+wmf1 Content-Encoding: gzip $ curl --compress -I 'http://tools-webproxy.eqiad.wmflabs/intuition/load.php?env=mw' HTTP/1.1 200 OK Server: nginx/1.5.0 Content-Type: text/javascript; charset=utf-8 X-Powered-By: PHP/5.3.10-1ubuntu3.14+wmf1 Hitting the lighty server directly from tools-login: $ curl --compress -I 'http://tools-webgrid-01:4134/intuition/main.js' HTTP/1.1 200 OK Content-Type: application/javascript ETag: "1806578031" Last-Modified: Thu, 05 Jun 2014 23:22:11 GMT Content-Length: 477 Server: lighttpd/1.4.28 $ curl --compress -I 'http://tools-webgrid-01:4134/intuition/index.php' HTTP/1.1 200 OK X-Powered-By: PHP/5.3.10-1ubuntu3.14+wmf1 Content-Type: text/html; charset=utf-8 Server: lighttpd/1.4.28 $ curl --compress -I 'http://tools-webgrid-01:4134/intuition/load.php?env=mw' HTTP/1.1 200 OK X-Powered-By: PHP/5.3.10-1ubuntu3.14+wmf1 content-type: text/javascript; charset=utf-8 Server: lighttpd/1.4.28 So gzip is added somewhere after lighttpd before, but before or in the proxy. And it's happening for php, but only for html from php, not js from php?
From urlproxy.conf in ops/puppet: gzip_types text/plain text/css text/xml application/json application/javascript application/x-javascript; So it's looking for application/javascript, rather than text/javascript. I could easily add support for text/javascript, but I'd prefer not to unless it causes issues somewhere...
And yes, compression is handled in nginx for most cases, rather than lighty.
Fixed by https://gerrit.wikimedia.org/r/166676
> dynamicproxy: Compress text/javascript as well > Change-Id: I91c83b557b3af3977919412325c9bb950480e88f