Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku Cedar and nginx (gzip)

According to the comments in the accepted answer here Rails how to Gzip Javascript? (Heroku) and the official cedar documentation (http://devcenter.heroku.com/articles/http-routing#the_herokuappcom_http_stack):

Since requests to Cedar apps are made directly to the application server – not proxied through an HTTP server like nginx – any compression of responses must be done within your application. For Rack apps, this can be accomplished with the Rack::Deflater middleware. For gzipped static assets, make sure that Rack::Deflater is loaded before ActionDispatch::Static in your middleware stack.

However, as far as I can tell, my app is running on herokuapp.com (cedar) and, according to the heroku logs, is using nginx to serve data (which is great). I've also confirmed via the Content-Encoding HTTP header that it is gzipping data to the browser. According to the documentation, that is NOT supposed to happen on cedar. Am I missing something here?

like image 604
kevlar Avatar asked Dec 15 '11 06:12

kevlar


1 Answers

You must be accessing these apps through a domain pointing to these IPs:

75.101.163.44
75.101.145.87
174.129.212.2

These are the apex faces and they are in front of both bamboo and cedar apps. Varnish is there for bamboo, but any request that goes through them ends up going through varnish too.

These faces are only for apex domains. If your app is under a subdomain such as www, it should be setup as a CNAME pointing to appname.herokuapp.com. When setup like that, requests will not go through varnish.

For more on Apex's and Heroku, see here: http://neilmiddleton.com/the-dangers-of-a-records-and-heroku/

like image 188
Neil Middleton Avatar answered Nov 08 '22 19:11

Neil Middleton