Gatsby Cloud offers two unique features that helps build your site faster than other platforms:
- Distributed Builds
- Incremental Builds
Distributed Builds streamline heavy work from the Gatsby build process by parallelizing it across multiple processes. This leads to a dramatic reduction in build times. If your site is using
gatsby version 2.19.5 or later and
gatsby-plugin-sharp version 2.4.0 or later, Distributed Builds are already working for your site.
Incremental Builds offer even faster speeds than Distributed Builds. It uses intelligent caching to determine which parts of your site need an update and then it only updates those parts. The only caveat is that currently, incremental builds can only be leveraged for data changes.
Code Changes Versus Data Changes
In the context of Incremental Builds, a code change is any change to a file in the repository that your site is connected to. That means that even if you only change something that is not involved in the build process (e.g. a README file or a .gitignore file), this still constitutes a code change. The same is true for files in a monorepo that are not strictly part of the directory from which the Gatsby site is built. As a rule of thumb, if the change involves a commit to your Git repository, it is a code change.
A data change is any change to content sourced from a content management system (CMS) connected to your site, e.g. Contentful, WordPress, etc. Things like correcting a typo in a post or swapping an image file will trigger an incremental build.
Enabling Incremental Builds
Incremental Builds are only available for paid plans and trials. Your site must also be using
gatsby version 2.20.4 or later. You can enable them on a per site basis via Site Settings.
You can identify an Incremental Build from the "incremental" badge on the build card.