Gatsby guide

Gatsby website review, the build time settings behind stale and slow pages

Stale builds, missing Head exports, a sitemap that only exists in production, images in static and scripts that block the first tap.
By Sunday Roast

A Gatsby site is built before anyone visits it, and that single fact explains most of what a Gatsby website review finds. Gatsby’s docs say static site generation is its default rendering mode, with the entire site prerendered into HTML, CSS and JavaScript at build time. Crawlers get finished HTML, which suits search. The catch is that the site only knows what was true at the last build, and a lot of Gatsby sites were set up years ago by someone who has since moved on.

So I check what the build produced, what it left out and whether anyone still knows how to run it. Each section names the Gatsby file or plugin to look at, all of them on Gatsby 5 unless noted.

Why is your Gatsby site still showing old prices or content?

A statically generated Gatsby page shows the content that existed when the site was last built. If your prices, team or opening hours live in a CMS, editing them there changes nothing on the live site until a new build runs and is deployed. Something has to start that build when you publish, such as a webhook from the CMS to your host. When that link breaks, or a build fails and nobody reads the log, the site freezes.

Check by changing one small thing in your CMS, then looking for it on the live page an hour later. If it never appears, ask who owns the build, where its logs are and when it last succeeded. A site that sells from a price nobody can update is a liability, and a visitor who meets a different price at checkout leaves. The hidden fees at checkout post covers what that gap costs.

Gatsby 4 added other modes for pages that change often. The rendering options guide describes Deferred Static Generation, which can build chosen pages the first time someone requests them, and server side rendering through getServerData. Both need a running server, which the docs point out for DSG, so they are a developer decision, not a setting you can switch on.

Gatsby sets titles and meta tags through the Gatsby Head API, a named Head export in each page file. The docs say it can only be defined in a page, which includes templates used by createPage, and not in a component. A blog post template that exports Head gives every post its own title. A layout component that tries to do the same does nothing.

Older Gatsby sites often use gatsby-plugin-react-helmet instead. Its own README says the package will be deprecated and points to the Head API, which Gatsby describes as easier to use, faster and smaller. If your site still uses Helmet, plan the move as part of the next round of work rather than in a hurry.

Gatsby’s SEO guide keeps the site wide values in siteMetadata inside gatsby-config.js. That is where your title, description, default share image and siteUrl live. A siteUrl still set to a starter’s example domain, or to an old preview address, leaks into the sitemap and any tag built from it.

View source on three page types and read the <title> and og:image tags. Gatsby lets you add an id to head tags so a page’s tag replaces the default instead of duplicating it. Two description tags in one head is a sign this was missed.

Does a Gatsby website review find a complete sitemap?

The gatsby-plugin-sitemap plugin writes a sitemap-index.xml file, and its README says it only generates output in production mode. Nobody sees it while working with gatsby develop, so it is easy to break without noticing. The README suggests testing with gatsby build && gatsby serve.

The plugin needs the site’s address. It reads siteUrl from siteMetadata unless you supply your own resolveSiteUrl. By default it lists every page, so thank you pages, test pages and drafts belong in its excludes option.

Open /sitemap-index.xml on your live domain and click through to the pages file. Look for your real domain, your newest page and the absence of anything private. Then make sure Google Search Console has the index address.

Are your Gatsby images going through the Gatsby Image plugin?

Gatsby’s image plugin has two components, StaticImage for images that never change and GatsbyImage for images that come from data. The docs suggest StaticImage for a logo or a front page hero. Because it is processed at build time, its src must be a fixed string, not a value passed in as a prop. Images from a CMS go through GraphQL with the gatsbyImageData resolver and display with GatsbyImage.

Files in the static folder skip all of this. Gatsby’s docs list the downsides plainly. Nothing in static is processed or minified, and filenames get no content hashes, so browsers can keep an old copy after you replace it. A hero photo saved there is served at full size to every phone.

Search the templates for plain <img tags pointing at /static or a CMS address. Each one is an image that may be heavier than it needs to be. Convert the ones on the first screen first.

What does a visitor see on a broken Gatsby link?

A page at src/pages/404.js is built as 404.html, which the docs say many static hosts use as their error page by default. If your host does not, it needs a rule to serve that file for missing addresses.

Do not judge your 404 page from gatsby develop. In development, Gatsby shows its own default 404 page, which lists every page on the site, with a Preview custom 404 page button. On the live site, type a made up address and see what a visitor gets.

Redirects depend on the host. Gatsby’s createRedirect action, called inside createPages in gatsby-node.js, records redirects, and since gatsby@5.12.0 adapters such as gatsby-adapter-netlify apply redirects and rewrites on the host. On a host with no adapter, test every old address by hand. A redirect written in code that the host never applies is a dead link.

Are third party scripts slowing your Gatsby pages?

Gatsby’s Script component loads outside scripts with a chosen strategy, and by default it waits until the page has hydrated. The strategies are post-hydrate, the default, idle for scripts that can wait until the browser is idle, and an experimental off-main-thread option that runs scripts in a web worker through Partytown. Chat widgets, heatmaps and ad pixels pasted straight into gatsby-ssr.js or the HTML get none of that control.

Old service workers are a quieter issue. The gatsby-plugin-offline plugin registers a service worker in production builds, and the docs name gatsby-plugin-remove-serviceworker as the way to remove it fully. If returning visitors report seeing an old version of a page, ask whether that plugin was ever installed.

Test on a phone over mobile data. Count how many seconds pass before the main button responds, then list every outside script the site loads. Anything not earning money or leads on that page can load later or go.

What does a Gatsby website review from Roast check?

Roast checks public pages in a browser on desktop, tablet and phone, scores them out of 100 and ranks the findings. It sees a stale price, a share card that shows the starter image, a heavy hero, a 404 page with no way forward and a button that stays dead while scripts load. Each fix has a ready prompt, and the sample roast report shows how they read.

A public scan cannot see your build logs, your CMS, your gatsby-config.js, your database, your emails or your payments. It cannot tell you whether the CMS webhook fires, only that the live page disagrees with what you expected. Everything a roast does look at is on what a roast checks. Gatsby pages are React pages once they load, so the React website review is useful for any parts of your site rendered only in the browser.

My pick is to change one word in your CMS today and see if it reaches the live site. Then run a free roast of your Gatsby site with no sign up, and buy the $5 full roast when you want every fix.

Your site next?

Find out what is putting your customers off.

A real browser checks your Gatsby site on a laptop, a tablet and a phone. Free score first, no sign-up.

Sources

Gatsby documentation