mozilla / persona-gmail-bridge

An experiment in building a minimal identity bridge for Gmail
Mozilla Public License 2.0
12 stars 6 forks source link

Make sure production is gzipping content #85

Closed callahad closed 11 years ago

callahad commented 11 years ago

This should probably be done at the nginx layer, right?

seanmonstar commented 11 years ago

Imma ganna guess that this is on default with the Persona stack that is used. But worth roping in @gene1wood

callahad commented 11 years ago

Looks like this is happening for most of our documents, but not the well-known file or heartbeat:

$ curl -s -I -H 'Accept-Encoding: gzip,deflate' https://google.login.anosrep.org/static/js/provision.js | grep Content-Encoding
Content-Encoding: gzip

$ curl -s -I -H 'Accept-Encoding: gzip,deflate' 'https://google.login.anosrep.org/static/css/style.css' | grep Content-Encoding
Content-Encoding: gzip

$ curl -s -I -H 'Accept-Encoding: gzip,deflate' https://google.login.anosrep.org/__heartbeat__ | grep Content-Encoding

$ curl -s -I -H 'Accept-Encoding: gzip,deflate' https://google.login.anosrep.org/.well-known/browserid | grep Content-Encoding

Those are tiny. Many there's some kind of size threshold before gzip kicks in?

callahad commented 11 years ago

Hm, nope. auth_failure.js is about the same size as the well-known file, but does get gzipped.

@gene1wood what's up with gzip in stage? :)

gene1wood commented 11 years ago

So here's your specific nginx config : https://github.com/mozilla/identity-ops/blob/master/chef/cookbooks/identity-bridge-gmail/files/default/etc/nginx/conf.d/idbridgegmail.conf

And here's your general nginx config which this is included from : https://github.com/mozilla/identity-ops/blob/master/chef/cookbooks/persona-common/files/default/etc/nginx/nginx.conf

I'd expect that the compression settings will be found in there. If so free free to send a pull request

seanmonstar commented 11 years ago

Yea, as I expected, it's related to content-type. __heartbeat__ returns plain text, and /.well-known/browserid returns application/json. That config file says it gzips for html, css, and javascript.

Heartbeat doesn't matter, since it's 2 separate characters, it can't possibly benefit from gzip.

callahad commented 11 years ago

Hooray, closing as working :)