Heroku rails 3.1 app - compiling assets locally vs compiling assets during slug compilation

后端 未结 2 1766
梦毁少年i
梦毁少年i 2020-12-20 12:28

I\'m running a rails 3.1 app on Heroku Cedar stack which supports the asset pipeline. Heroku lists 3 ways to compile assets

  1. Compiling assets locally.
2条回答
  •  不知归路
    2020-12-20 13:21

    It could depend on the size of your asset folder, (and maybe a long term solution would be to put those assets outside the application and host them on S3 or the like.)

    Otherwise, I am supposing #1 would be the best on production since any asset can be used and cached straight away.

    I am reading Heroku's documentation section on assets, and they seem to indicate that #2 would be used just in case you have forgotten to do it yourself, as a convenience. You will not get a small slug, since the results of asset preparation will be included in the slug to deploy itself.

提交回复
热议问题