Last modified: 2014-10-17 05:11:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T73995, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 71995 - WMFLabs: Gzip text/javascript responses from fcgi (just like text/html)
WMFLabs: Gzip text/javascript responses from fcgi (just like text/html)
Status: RESOLVED FIXED
Product: Wikimedia Labs
Classification: Unclassified
tools (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Yuvi Panda
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-13 12:46 UTC by Krinkle
Modified: 2014-10-17 05:11 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2014-10-13 12:46:20 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
Comment 1 Krinkle 2014-10-13 13:11:14 UTC
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?
Comment 2 Yuvi Panda 2014-10-13 17:52:32 UTC
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...
Comment 3 Yuvi Panda 2014-10-13 17:54:37 UTC
And yes, compression is handled in nginx for most cases, rather than lighty.
Comment 4 Yuvi Panda 2014-10-14 21:53:20 UTC
Fixed by  https://gerrit.wikimedia.org/r/166676
Comment 5 Krinkle 2014-10-14 21:53:52 UTC
> dynamicproxy: Compress text/javascript as well
> Change-Id: I91c83b557b3af3977919412325c9bb950480e88f

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links