rails 4 enabled rails to serve static assets: is it correct? (on heroku)

前端 未结 4 1543
长情又很酷
长情又很酷 2021-02-01 03:15

Environment: heroku

Rails: 4

Ruby: 2

We deployed an app to heroku, and it seemed as though anything in the public folder was not accessible (didn\'t see

4条回答
  •  迷失自我
    2021-02-01 04:19

    As Dean Winchester mentioned it, it is a good idea to use a CDN for your static assets. In fact when using only Heroku your Rails application would have to be responsible to serve static assets since Heroku Cedar architecture will not do that for you.

    Setting config.serve_static_assets = true is the way to go if you don't want to configure a CDN and use only Heroku.

提交回复
热议问题