I have a Rails 3.2 application that I am deploying on the Kerok Geroku stack. This means that the application itself is responsible for maintaining its static assets. I would like these assets to be gzipped, so I inserted Rack::Deflater
into my middleware stack in production.rb
:
middleware.insert_after('Rack::Cache', Rack::Deflater)
... and curl
tells me that it works as advertised.
However, since Heroku is working hard to launch rake assets:precompile
, creating a bunch of pre-gzip assets, I would really like to use them (instead of letting Rack::Deflater
do all the work again). I saw recipes for serving them with nginx (without using Heroku) and with CDN (I donβt want to use CDN yet), but I did not see anything that could be run separately. I hacked into the middleware rack to do this, but I was wondering if this is the best way to do this?
source share