Static site: old way vs new way
The popular new way for hosting “static site” is using the JAMStack platform. I have used others in the past, but currently I have been using Cloudflare Pages for two years exclusively.
It is good, but it has its drawbacks.
Every new post / page that I push (via git) will trigger a new build. Sometimes the build fails.
I found it bizarre that even pure static hand-coded HTML still requires a build. And when a build fails, by default, I got no alert, so I was sometimes surprised when I happen to go to the website and saw that the morning's push did not show up.
Maybe there is a way to get an alert somewhere along the workflow.
Each build takes time.
It's gotten faster, but still time to spend waiting, since I need to check that the build succeeds.
Compare to the old way
The new way is not always better than the old way. Just a different set of trade offs.
The “old” way, which is still popularly used today, that I did was using an HTTP server (Caddy, Apache, NGINX, Lighttpd, etc) + static files.
To deploy, all we need to do is upload the static files to the server and the new content is instantly up. It is actually very convenient, but it has its drawbacks too.
Security is on us.
If we misconfigure the HTTP server or late in patching the OS, then that opens up risk. So we need to have the process to keep them always updated.
On a JAMStack platform-as-a-service / PaaS, we focus on our app's / website's security only. The rest is taken care of by the platform security experts.
Load balancing is on us.
It is up to us to set load balancing up front and this costs extra. Plus it requires additional skill.
And I think this is the allure of the new PaaS, someone will take care of the auto-scaling for us.
It is a choice
I am in the beginning stage of setting up a new project. For some reason, I was drawn to retry the old way of doing things and rented myself a server.
There are inconveniences. But it is not rocket science. And there is something in the familiarity of the process and the simplicity of it that made me think: this might be good for me in the long run.
Or maybe it was just nostalgia.