Assets pipeline when updating to Rails 3.1 on Heroku

岁酱吖の 提交于 2019-12-03 03:45:41

I was wondering the same thing, but here's a tip to help figure out if your assets are live-compiling or not

  1. run rake assets:precompile locally
  2. make some changes to your css but do not rerun the rake task
  3. git add, commit and push to heroku

If the changes you made in step 2 show up on heroku, then you know your app is live-compiling

Don't forget that you are now in charge of http caching since Varnish is no longer included on celadon, so you need to set up rack-cache and memcached yourself:

But yeah, I found this puzzling too

Also, take a look at http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets

For faster asset precompiles, you can partially load your application by setting config.assets.initialize_on_precompile to false in config/application.rb, though in that case templates cannot see application objects or methods. Heroku requires this to be false

Can you try with config.serve_static_assets set to true and

config.action_dispatch.x_sendfile_header = "X-Sendfile"

added to your config/environments/production.rb file?

When you push your code to Heroku you should see the precompiling announced by the slug compiler AFAICT.

Make sure you are on the Heroku "Cedar" stack. Then Heroku will automatically precompile your assets during slug compilation.

Note: I'm still getting "cache misses" too, but I don't think that's really true because your app wouldn't work if your assets weren't compiled.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!