No need to host static sites on Heroku
- Transfer
From translator
After reading the articles about Heroku, I wondered about the placement of simple, static web applications there. At first, everything was perfect, but I was confused by the inability of Heroku to give static. Even for such a simple task, I had to write small applications that only did what they gave static content. Although, as for me, the same nginx would be better able to cope with this task.
Under cat translation of the article by Michael Bleigh from Divshot on why you do not need to host statics on Heroku
No need to host static sites on Heroku
Heroku is an incredible platform. No really. In Divshot, we have already launched 20 applications on Heroku, and personally I have at least 30 applications running. This is my favorite hosting platform for Ruby and Node.js projects. But you are deeply mistaken if you host static sites on Heroku.
Yes, hosting static sites on Heroku is tempting. They even have documentation that shows how to do this. After all, it is so simple to get an application on Heroku. You are already using it for everything else, why not use it for this?
- It is expensive. To ensure your site is constantly working, you will have to use an additional dyno (the price of $ 0 applies only to the use of one dyno, which should be idle for at least 6 hours a day - approx. Translator) . It will cost you at least $ 37 a month. Just to host static files.
- Static sites do not need application servers. Blog entries you'll probably find will recommend you use Rack or Node.js to host your static content on Heroku. It’s the same as hiring Ilona Mask to deliver coffee to your office. To make matters worse, it may turn out that Elon Musk does a poor job of delivering coffee, because he is really good at innovative activities.
- Geostationarity . Only two regions are available in Heroku: the USA and Europe, and your application will be placed in one of them. Static content must be delivered via CDN so that your users receive it from the nearest server.
Further, the author offers as an alternative his own Divshot service. I invite everyone interested to read https://divshot.com/
If you post static content, I urge you to use something that is suitable for the task. It can be Amazon S3 (preferably with CDN), or GitHub Pages, or nginx. Maybe even a Divshot. (Selectel Storage is a good fit - approx. Translator) . You just don't have to write entire Ruby / Node.js applications for static content.
Taking this opportunity, I want to ask Habr how you host your static sites?