Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Gatsby 4 - More Than a Static Content Generator

Gatsby 4 - More Than a Static Content Generator

This item in japanese

Gatsby 4, the latest iteration of the popular static site generator, is now out, offering developers improved build speeds alongside new ways for delivering content.

Static site generators like Gatsby became popular in recent years as they offer developers and content creators a fast and secure way of serving websites without the need for a database by generating the HTML content beforehand.

In its latest iteration, Gatsby's most significant improvement comes in the form of two additional approaches to serving content, aligning it closer to traditional content management systems.

In addition to the traditional static site generation (or SSG) that exists in previous versions, Gatsby 4 now supports two new rendering options - Deferred static generation (or DSG) and traditional server-side rendering (or SSR); both rendering options can be enabled to a subset of the content items.

As its name applies, static site generation requires that the entire site content be re-rendered on every change. This works great for the smaller websites with relatively few content items - but with sites that contain thousands of articles, the process becomes time-consuming, with build times easily topping 10 minutes.

When using deferred static generation, Gatsby will wait for the first time a user requests a content item before generating it. This option is helpful for older content that is rarely used and prevents the upfront time of generating content that users may never access.

In contrast, when choosing the traditional server-side rendering, Gatsby will render the content whenever a user requests the page. This option is relevant for highly dynamic content such as user reviews or comments that need to be indexed quickly by search engines.

The downside of both options is that Gatsby will now need to keep its content generation server constantly running instead of only using it during the initial content generation.

In addition to the new content generation options, Gatsby will now use parallel query processing, taking advantage of multiple processor cores to speed up content generation.

Developers interested in testing the new release are advised to follow the upgrade guide found in the following link as the latest release does include a few breaking changes.

Gatsby is open-source software available under the MIT license. Developers are encouraged to participate in the development of Gatsby by following the Gatsby contributor covenant code of conduct.

Rate this Article