config.assets.compile=true in Rails production, why not?

前端 未结 7 1737
闹比i
闹比i 2020-11-22 07:17

The default Rails app installed by rails new has config.assets.compile = false in production.

And the ordinary way to do things is to run

7条回答
  •  不思量自难忘°
    2020-11-22 07:58

    For anyone using Heroku:

    If you deploy to Herkou, it will do the precompile for you automatically during the deploy if compiled assets are not included (i.e. public/assets not committed) so no need for config.assets.compile = true, or to commit the precompiled assets.

    Heroku's docs are here. A CDN is recommended to remove the load on the dyno resource.

提交回复
热议问题