Why I choose Jamstack

Why did I go with Jamstack and not use something like Wordpress?
I believe the short answer is best described on Jamstack.org:
Jamstack is an architecture designed to make the web faster, more secure, and easier to scale. It builds on many of the tools and workflows which developers love, and which bring maximum productivity.
And besides that I also like to experiment with new technology. So follow along below, and I'll explain a bit more around what Jamstack is and it's pros and cons.
What is the Jamstack?
The Jam in Jamstack stands for Javascript, Apis, Markup. What that basically mean is that the site is pre-rendered as static html, and any interactivity is implemented using client side JavaScript and backend APIs.
Pre-rendering
There are a lot of tools for pre-rendering markup. Sometimes these tools are also referred to as Static site generators, or SSG:s. Some examples of Static Site generators are:
And the one I went with: Nuxt.js
The principles for these tools is that you pre-render the entire front end as static pages which can then be hosted directly on a CDN.
Pros and cons
Like with anything, there are always pros and cons. Below is my take on the biggest up- and downsides of using the Jamstack.
Pros
Security
With no servers that can be hacked, and only static content served the security on Jamstack pages is extremely high. The penetration surface is limited to any API:s used.
Speed
Page loading speeds have an impact on user experience and conversion. Jamstack sites remove the need to generate page views on a server at request time by instead generating pages ahead of time during a build.
With all the pages are already available on a CDN close to the user and ready to serve, very high performance is possible without introducing expensive or complex infrastructure.
Cost
This ties tightly to the same reasons as the Security point. By only serving static content you won't have to pay for any servers. You basically only pay for the domain and (sometimes) the traffic for the hosting. Most CDN:s have free plans that is enough for most smaller sites. For instance Cloudflare Pages, which this site uses, has a free plan with unlimited requests and unlimited bandwidth.
Scalability
Popular architectures deal with heavy traffic loads by adding logic to cache popular views and resources. The Jamstack provides this by default. When sites can be served entirely from a CDN there is no complex logic or workflow to determine what assets can be cached and when.
With Jamstack sites everything can be cached in a content delivery network. With simpler deployments, built-in redundancy and incredible load capacity.
Portability
Jamstack sites are pre-generated. That means that you can host them from a wide variety of hosting services and have greater ability to move them to your preferred host. Any simple static hosting solution should be able to serve a Jamstack site.
Bye-bye infrastructure lock-in.
Cons
The need for technical knowledge
Although there are some premade templates and quickstarters, and a lot of open source plugins etc. you will have to have quite a bit of technical knowledge. Or hire people who have.
This one is sort of valid for things like Wordpress too. At least if you are building custom things and want to self host your application.
Time to market
This one is more of a maybe. Since you would presumably have to build a lot yourself, rather than using ready made themes and plugins it will take a bit longer to get up and running. Even if you are not building custom things you will have to compose your application of the plethora of existing and ready made plugins rather than clicking a button and be ready to go.
Final words
This topic is definitely both exiting and has a lot to cover, so it will be something that I have to get back to further down the road. Until next time! 👋