1
votes

On every push to Heroku, all assets are precompiled, so not only assets that have changed. Asset precompilation thus takes more than 250 seconds. I tried all suggestions I found online, but I can't seem to fix it.

I have installed the rails_12factor gem as suggested by Heroku. Static assets are hosted on Cloudfront. We use Bower-Rails for front-end dependencies. Unicorn is the server on Heroku.

These are some settings in the production.rb environment:

config.serve_static_assets = true
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
config.assets.compile = true
config.static_cache_control = 'public, max-age=31536000'
config.assets.compress = true
config.assets.digest = true

Has anyone experienced this as well? Or can anyone help me?

1
same. have you found a solution?jsharpe
We have not found a solution. For us it is no longer an issue, since we are using Rails as API only, so we aren't using the Rails pipeline any more.BenSw

1 Answers

0
votes

Have you tried running this before pushing to heroku?

bundle exec rake assets:precompile RAILS_ENV=production

Then do a git commit and git push heroku master I wanted to post this as a comment but didn't have the rep ><