加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-17 02:48:41 所属栏目:百科 来源:网络整理
导读:我想使用Heroku来托管我的 Ruby on Rails项目.它将涉及大量文件上传,主要是图像.我可以在Heroku上托管和提供静态文件,还是使用Amazon S3等服务更明智.您对该方法有何看法?在Heroku上托管静态文件有哪些选择? 解决方法 为了回答你的问题,Heroku的“短暂文件
我想使用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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读