📜 ⬆️ ⬇️

No need to host static sites on Heroku

From translator


Having read articles about Heroku, I wondered about the placement of simple static web applications there. At first, everything was fine, only I was confused by the inability of Heroku himself to give statics. Even for such a simple task, you had to write small applications that did nothing but render static content. Although, as for me, the same nginx would be better with this task.

Under the cut, the translation of the article by Michael Bleigh from Divshot on why not to host the 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 I personally 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 place static sites on Heroku.

Yes, placing static sites on Heroku is tempting. They even have documentation that shows how to do this. It's so easy to get an application on Heroku. You already use it for everything else, why not use it for this?
')
  1. It is expensive. To ensure your site a permanent job, you will have to use an additional dyno (the price of $ 0 only applies to the use of one dyno, which should be idle for at least 6 hours a day - translator) . It will cost you at least $ 37 per month. Just to place static files.
  2. Static sites do not need an application server. The blog entries that you will surely find will recommend you to use Rack or Node.js to post your static content on Heroku. It's like hiring Ilona Mask to deliver coffee to your office. Worse, it may turn out that Ilon Mask does not cope well with coffee delivery, because he is really good at innovation.
  3. Geostationary . In Heroku, only two regions are available: 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 can get it from the nearest server.


Further, the author offers as an alternative his own Divshot service. I invite all interested to familiarize with https://divshot.com/

If you post static content, I urge you to use something that is suitable for the task. This could be Amazon S3 (preferably with a CDN), or GitHub Pages, or nginx. Maybe even Divshot. (Selectel Storage is a good fit - approx. Translator) . You just do not need to write entire Ruby / Node.js applications for static content.

Taking this opportunity, I want to ask Habr how you host your static sites?

Source: https://habr.com/ru/post/257969/


All Articles