Image loss issue
-
Hi guys!
I am facing a problem that I am not sure where it go wrong. I have created a forum website hosting on Heroku and the db is redistogo. I have upgrade my Heroku to Hobby tier and redistogo to mini($9/m).
The website works well and everything is good. However whenever the website idle(no incoming traffic) for an unknown hours of time (maybe 5-7 hours). When I open up the webpage, I would loss all my category icon image and website logo. I would then need to manually upload it again. Here is what it look like
Normal: http://postimg.org/image/590xsrabn/
Broken: http://postimg.org/image/dvmea3wnx/
Heroku setting: http://postimg.org/image/r0eh687vb/I am not sure what went wrong and I already double check that I am not using the free tier dyno. For now I disallow user to upload profile image and post image fearing that they might lose their image too. If anyone has experience this before or has any suggestion please let me know
Thanks
-
@linan2332 do you use the Imgur upload?
-
Hmm, doesn't Heroku hibernate there packages if I'm correct? Maby it has something to do with this issue,
-
@linan2332 Heroku spins up and down dynos using what is called an "ephemeral file system". This means that the codebase is regenerated every time it is spun up, meaning the
public/uploads
directory, where you are uploading your assets, is being reset.You will need to upload your images to a CDN or some other hoster, and then paste those links in the config instead of uploading directly to your Heroku.
If you have the imgur plugin, post uploads will be ok as they are sent to Imgur.
-
@linan2332 after you install and activate imgur plugin, site logo and category image upload also uploads to imgur.