Heroku Cedar and nginx (gzip)
Asked Answered
T

1

9

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?

Tweeter answered 15/12, 2011 at 6:30 Comment(2)
Likewise I was under the impression Cedar didn't use Varnish for cashing, and yet on my app (www.get3sixty.com), there is a Via: varnish header. I suspect they just haven't updated the docs, but would be good to know that for sure!Impalpable
weird! it seems quite hit or miss - I've checked 4 of my apps that I know are on Cedar, 2 report the varnish header, the other 2 don't.Resect
G
10

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/

Gynous answered 15/12, 2011 at 16:0 Comment(1)
As you had guessed, we are indeed pointing all of our www's to the A records instead of using CNAMEs. Thanks for the enlightening post.Tweeter

© 2022 - 2024 — McMap. All rights reserved.