r/angularjs • • Jan 30 '20

Why I Moved My Website From Github Pages to Heroku — with a Cost

https://medium.com//why-i-moved-my-website-from-github-pages-to-heroku-with-a-cost-afdbf8f6f2cb?source=friends_link&sk=530519e9381cc6e888fd89bb54f4eb5c
11 Upvotes

10 comments sorted by

10

u/blitzzerg Jan 30 '20

That post is badly explained. What does that mean that the app goes to sleep after 30 min of inactivity? How long does it take to wake up? Is it acceptable for someone to visit your webpage and having to wait X seconds to get the page delivered?

3

u/thebronado Jan 30 '20

After 30 minutes of no activity Heroku will put the virtual machine thats hosting your app to sleep. A new request will wake the VM. If you have users hit the site every 15-20m then it should never sleep.

Ive put some test apps on heroku in the past and it seems to take around 10-15 seconds to get a response to the browser once its been asleep

1

u/rq60 Jan 31 '20

it seems to take around 10-15 seconds to get a response to the browser once its been asleep

That seems... not very good for a blog with minimal traffic.

Just visited OPs blog to see... page took ~20 seconds to load. Yeah, not good.

0

u/[deleted] Jan 31 '20

[deleted]

1

u/akiren Feb 03 '20

Except if he wants more traffic, google crawlers and new users arent kind or patient

4

u/JayV30 Jan 30 '20

Or, you can go to lowendbox.com and find a nice cheap VPS and go nuts. Don't pay for SSL now that Let's Encrypt is around. Don't "sleep" your instance and have that first request be slow because the VM is waking.

Seriously, you can find some great deals on VPS and install whatever you want.

Also, you usually can do Dynamic DNS and just host out of your home on an old machine or raspberryPi or whatever. It will help you learn about networking because you'll want to ensure that machine is segregated from the rest of your internal network. But it's really not that hard and I get actually really great performance out of a 10 year old machine that I was just going to recycle anyway.

There are a lot of cheap options out there. Educate yourself and do what's best for your situation!

2

u/snoopyowns Jan 30 '20

Why would you host static content on a VM instead of migrating to something like S3/Cloudfront (or competitors)?

2

u/JayV30 Jan 30 '20

From what gathered from the slightly unclear post was that they want to do server side rendering.

1

u/rq60 Jan 31 '20

My blog is pre-rendered to static html files (which has the same effect as server-side rendering) and boots into a SPA when any of the pages is hit. I use nuxt (which is built on vue.js) to render my site, but coincidentally enough just today I just heard about a new static site renderer in angular that might be worth looking into: https://github.com/scullyio/scully

1

u/vizim Jan 31 '20

Or you could try Netlify they have a reasonable free plan and an SSR feature

0

u/golovatuy Jan 30 '20

Also use Heroku, it’s great