几个小时后图像消失 [英] Images disappear after few hours

查看:85
本文介绍了几个小时后图像消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个小票务系统: http://ticketsystemkm.herokuapp.com/
我有电影海报,可以在主站点上显示它们.
当我拍新电影时,一切正常,但是几个小时后图像消失了. 也许有人遇到过类似的问题,并且知道如何解决.

I want to create little ticket system : http://ticketsystemkm.herokuapp.com/
I got posters for movies to display them on main site.
When i make new movie everything works good, but after few hours images disappear. Maybe someone had similar problem and know how to solve it.

推荐答案

猜测您的图像是用户通过回形针或类似的东西上传到您的公用文件夹的,这就是为什么它们消失的原因.如果您的应用程序在15分钟左右的时间内没有收到任何流量,则驻留在其中的VM将被销毁,并且公用文件夹也将随之存在.

Guessing your images are user uploads via Paperclip, or something of the like, to your public folder, which is why they're disappearing. If your app doesn't receive any traffic for 15 minutes or so, the VM it lives on is destroyed, and the public folder goes along with it.

您需要将资产存储在S3或其他一些CDN上.另一个选项是将相关资产检入版本控制到app/assets/images.

You need to store your assets on S3, or some of other CDN. The other option is to check the relevant assets into version control into app/assets/images.

可以在这里找到更详细的解释(和解决方案): https://devcenter.heroku.com/articles/paperclip-s3

A more detailed explanation (and solution) can be found here: https://devcenter.heroku.com/articles/paperclip-s3

这篇关于几个小时后图像消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆