You might have heard web developers talking about Jamstack, or "modern static web development", but what is it exactly? This post provides an overview of what Jamstack is and the benefits of building your next website the Jamstack way.
When a user visits a page on the website, the webserver finds the file they requested and sends it to them.
As the internet grew, so did content requirements. We needed ways of handling sites with thousands or even millions of pages. We also wanted ways of customizing a page based on who’s looking at it. These requirements gave rise to dynamic websites.
When a user visits a dynamic website, the webserver runs code to generate the website on the fly. It might collect content from a database or API, build the layout from a theme, or create a breadcrumb from a plugin; anything is possible. Once the page generates, it’s returned to the user.
Dynamic websites created new possibilities for the web. The web became much more interactive and tailored to you as an individual. However, with this new approach came a great deal of complexity. Instead of having a web server delivering files, you have programming languages, databases, caching layers, and plugins, which all need to work together flawlessly to deliver a web page. If one piece of the stack breaks, the whole site goes down.
Static site generators (SSGs) started rising in popularity around 2008 to address the pain points of dynamic websites. A static site generator brings some of the advantages of a dynamic website to a static website. You can programmatically build web pages, retrieve content from a database or API, use layouts and includes just like on a dynamic site. The difference is a static site generator goes through a build process that prerenders all of the pages on the site. So after the build process is complete, you have an entirely static website — just like Tim Berners-Lee did with his first website. Any time you change content or any other source files, you rebuild the site, generating an entirely new static website.
Static websites of today are capable of so much more than they were in the 90s. We needed a new term to talk about the capabilities of modern static websites without the preconceived limitations of a “static website”. The term Jamstack was coined in 2015 to talk about this new approach to building websites, and it stuck.
A Jamstack site is anything from a simple static website to a single-page web app that retrieves data from an API. Jamstack is the philosophy of prerendering the static parts of a website and retrieving data for the dynamic components from APIs.
To cut to the chase, building Jamstack is faster, easier and there’s less that can go wrong. The benefits include:
Jamstack is a new approach to building websites and there are new technology and workflows you’ll need to pick up. Fortunately there are plenty of tutorials, resources and services which help make this straight forward:
The first step to building a Jamstack website is choosing a static site generator (SSG). There are many different options available, each with its pros and cons. The most popular include Jekyll, Hugo, Gatsby, Next.js, and Nuxt.js. Following an introduction tutorial and building a small project is the best way to get your feet wet. CloudCannon offers learning path tutorials for Jekyll and Hugo for those getting started.
You’ll typically set up a repository for your source files. As you develop, you’ll have the SSG running a local server. When you change a file, the SSG will rebuild the site and push the changes to the local server, which you can view from a browser.
When you’re ready to publish your Jamstack site, picking a Jamstack-aware hosting service makes the process easy. Connect your repository to the hosting provider, and it will automatically pull in any changes, start a build and deploy the resulting static site on a CDN.
Content editors typically aren’t familiar with Git or HTML, let alone running an SSG build on their local machine. Fortunately, many Jamstack CMSs provide a friendly user interface for managing content on Jamstack websites. There are two approaches to managing content: API-based and Git-based. With API-based CMS, you create and manage your content on the platform and pull it in using their API as part of the SSG build.
A Git-based CMS like CloudCannon takes a different approach. It syncs your files from your repository and provides an editing interface to update the content. When you save a file, the CMS commits it back to the repository, so you always maintain control and ownership over your content.
CloudCannon is a platform that makes working with Jamstack sites easy. It’s everything you need to sync, build, edit and host Jamstack websites all in one place.
To get started, you can sign up for our free 14-day trial and connect your Jamstack repository with CloudCannon. CloudCannon automatically pulls in your files, builds the site, and deploys it to fast CDN hosting. You can share CloudCannon with your team to update content directly on your website using a Git-based visual editor.
One of the best things about Jamstack is the community and resources available to help you learn. Here’s some of our favorites:
Give your content team full autonomy on your developer-approved tech stack with CloudCannon.
Jaimie McMahon · 27 Sep 2023
Jaimie McMahon · 8 Sep 2023