Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7743805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:37:43+00:00 2026-06-01T09:37:43+00:00

I have a Rails 3.2 app that I’m deploying on the Heroku Cedar stack.

  • 0

I have a Rails 3.2 app that I’m deploying on the Heroku Cedar stack. This means that the app itself is responsible for serving its static assets. I’d like these assets to be gzipped, so I’ve inserted Rack::Deflater in my middleware stack in production.rb:

middleware.insert_after('Rack::Cache', Rack::Deflater)

…and curl tells me that this works as advertised.

However, since Heroku is going to all the effort of running rake assets:precompile, producing a bunch of pre-gzipped assets, I’d quite like to use those (rather than letting Rack::Deflater do all the work again). I’ve seen recipes for serving these up with nginx (no use on Heroku), and with CDNs (not wanting to use a CDN just yet), but I haven’t seen anything that can just run standalone. I’ve hacked together a rack middleware to do this, but I was wondering if this is the best way to go about it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:37:45+00:00Added an answer on June 1, 2026 at 9:37 am

    Since deflater is after rack cache, then deflator will only have to do the work once, and after that the compressed assets will be served from rack cache (assuming the cache is big enough so that they don’t get bumped out occasionally).

    That said, your middleware looks pretty cool, and you should make make it a gem and blog about it, maybe it will be what people start to use 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails app that I have serving up XML on an infrequent
I have a Rails app that uses Cloudfront as its CDN and sprockets to
I have a rails app that I've been testing on heroku, it's a simple
I have a Rails app that saves files in mongo. This works great and
I have a rails app that needs a lot of initial data. This data
I have this Rails app that can be spawned (by Passenger) a number of
I have Rails 3.1 app that I'm currently hosting on Heroku. My problem is
This is a bit complicated but here goes. I have a Rails app that
I have a Rails app that I have successfully tested with Mongrel and Webkit.
I have a Rails app that I need to deploy. Here are the facts:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.