With the launch of Deferred Static Generation in Gatsby 4, Gatsby Cloud has added another method of drastically reducing the time it takes to make updates to your static site – the biggest drawback of any SSG. Where Incremental Builds solved many of the long build problems for content creators, Deferred Static Generation is meant to help speed up the entire build process for development teams, even from a cold start.
Let’s take a look at how Gatsby Cloud uses both Incremental Builds and DSG to cut down publishing times.
Incremental Builds launched last year on Gatsby Cloud and has saved thousands of teams, millions of hours of build time. By rebuilding only the HTML that was edited, Incremental Builds reduce the build times coming from data sources, like Contentful and WordPress, by 90%. Sites that have thousands of pages can expect content to be updated and rebuilt in seconds, not minutes.
Deferred Static Generation
Deferred Static Generation (DSG) is one of Gatsby’s rendering options and allows you to defer non-critical page generation to user request, speeding up build times. Instead of generating every page at build time, you can decide to build certain pages upfront and others only when a user accesses the page at run time. For large sites, with content that is infrequently visited (e.g. old blog posts or certain content types), this can dramatically reduce build times.
How they differ
Incremental Builds actually regenerates the content on a Gatsby website, sourced via a Gatsby Plugin like Contentful, in real-time. This saves time by only rebuilding the small piece of the website that was changed or added, instead of rebuilding every single page and asset.
Deferred Static Generation affects more of the deployment phase, as it gets the build out the door with the most necessary pages already built and then lets user requests drive the rest of the build during run-time.
How to take advantage of both
To use Incremental Builds on Gatsby Cloud and get the fastest possible content updates, all you need to do is create an account and purchase any paid plan. You’ll get the speed your content creators and marketers need to productively work in a Jamstack world.