ndbroadbent / turbo-sprockets-rails3

Speeds up your Rails 3 assets:precompile by only recompiling changed files, and only compiling once to generate all assets
MIT License
976 stars 78 forks source link

H13 error on heroku when rack-zippy is enabled #99

Open thebravoman opened 9 years ago

thebravoman commented 9 years ago

If I have this configuration: in config/initializers/rack_zippy.rb

if Rails.env.production? Rails.application.config.middleware.swap(ActionDispatch::Static, Rack::Zippy::AssetServer) end

And I deploy on heroku with unicorn, then the following error starts occuring

2014-10-21T19:54:42.109165+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/assets/application-fcb51b49359ab5defedcd69eb52979f2.js" host=www.fllcasts.com request_id=08960e1b-24ec-40d6-ba5e-101e1f7e279f fwd="91.92.162.5" dyno=web.3 connect=3ms service=15850ms status=503 bytes=0

And everytime application-...js is called tihs error occurs.

thebravoman commented 9 years ago

This is what heroku support said:

"Yeah, Rack::Zippy sounds cool, but it needs to work. :)

I've used Rack::Deflate in the past, which gzips all your responses if inserted near the top of your middleware (not just your assets). You can then put a CDN like Cloudfront in front of your app cache all your assets so your app will never serve an asset twice. That's how I've addressed this in the past.

Anyway, I'm not sure what the problem with Rack::Zippy is exactly... I've not used it personally. I was able to reproduce the problem inside a dyno just sending it a request, so I imagine you could reproduce this locally in production as well. "