I’ve been a longtime fan of Gatsby. About a year ago I joined a team that deploys Gatsby-based sites to Kubernetes. Since then, I’ve been chasing after the best (and maybe cheapest) way to implement incremental builds in a production environment. You might think of it as a self-hosted alternative to the major providers like Gatsby Cloud, Netlify, Vercel, etc.
An incremental build is a build of Gatsby that generates only the subset of HTML files that needed to be updated based on the changes made to the site. Changes to page templates, page queries, static queries, and frontend source code cause HTML files to be marked for regeneration.
Basically, your CMS sends a POST call to a given web-hook when things change and triggers a build on the infrastructure/backend side. The challenge is - build infrastructure isn’t easily available in OSS. It’s unclear* how the major providers manage the web-hooks and build Gatsby sites. It’s especially interesting when you get to providers like Gatsby Cloud who claim to rebuild (incrementally) at numbers like 1-5 seconds.
*Netlify is a huge exception in that, a lot of their infrastructure is surprisingly available on GitHub
A webhook that builds Gatsby via an Express endpoint with a FIFO queue.
Instantly share code, notes, and snippets. A webhook that builds Gatsby via an Express endpoint with a FIFO queue. You can't perform that action at this time. You signed in with another tab or window. You signed out in another tab or window. Reload to refresh your session.