gpt4 book ai didi

ruby-on-rails - Heroku - 为我的项目托管文件和静态文件

转载 作者:行者123 更新时间:2023-12-03 00:33:39 29 4
gpt4 key购买 nike

我想使用 Heroku 托管我的 Ruby on Rails 项目。它将涉及大量文件上传,主要是图像。我可以在 Heroku 上托管和提供静态文件吗?或者使用 Amazon S3 等服务是否更明智?您对这种方法有何看法?在 Heroku 上托管静态文件有哪些选项?

最佳答案

回答你的问题,Heroku 的“临时文件系统”不会用作静态上传的存储。 Heroku 是一个应用程序服务器。您必须插入其他地方的数据存储。

来自 Heroku 的 spec :

Ephemeral filesystem

Each dyno gets its own ephemeral filesystem, with a fresh copy of the most recently deployed code. During the dyno’s lifetime its running processes can use the filesystem as a temporary scratchpad, but no files that are written are visible to processes in any other dyno and any files written will be discarded the moment the dyno is stopped or restarted. For example, this occurs any time a dyno is replaced due to application deployment and approximately once a day as part of normal dyno management.

关于ruby-on-rails - Heroku - 为我的项目托管文件和静态文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31843709/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com