Skip to content




Whitepaper No. 01 · Performance · 3 min read

Fast by defaultA performance playbook for headless Next.js sites

Jono Alford, Hrithik Prasad, Sne Tripathi · Roboto Studio ·


Abstract

On the slow headless sites we've rebuilt, the time went to the same four places: builds, how content was fetched, code nobody needed and redirects nobody kept.

Key findings

faster deploys at Tray.ai: 24 hours down to two minutes
99.86%

2 min after 1,440 min before · Tray.ai deploy

pages moved to Vercel in six weeks, progressively rather than in one cutover
500k
full builds at Jamb and Trippin World, both down from 30
3 min

01 What this paper covers1 / 7 Contents

What this paper covers

This is the order we work in when a headless Next.js site is slow to build, slow to load or slow to change. Each section names the projects it comes from, and the sources at the end link to every case study the numbers were measured on.

Among them are sites on Contentful, Sanity and Shopify. Two moved from AWS to Vercel, and one was rebuilt from two PHP sites.

Builds come first

A slow build doesn’t show up in Lighthouse, but it decides how often a team can ship. Tray.ai ran Next.js 9 on AWS Serverless functions, with 250 MB packages choking every deploy. Previewing a change meant a full production build, and failed deploys were a weekly ritual.

We consolidated five repositories into one Turborepo monorepo on Next.js 13, with hybrid static and server rendering across 25 page types. Deployments that once took 24 hours now finish in two minutes: 99.86% faster.

Three smaller sites each started at 30 minutes a build.

Full build time before and after, in minutes#

  • Before
  • After

Bulletproof, Jamb and Trippin World case studies, robotostudio.com/case-study.

Bar chart of Before, After across 3 site values: Before is 30 throughout; After is highest for Bulletproof (4) and lowest for Jamb (3).

Full build time before and after, in minutes. Bulletproof, Jamb and Trippin World case studies, robotostudio.com/case-study.
SiteBeforeAfter
Bulletproof304
Jamb303
Trippin World303

Bulletproof’s builds dropped by 87% through incremental static regeneration and a reworked build toolchain, as part of a move from AWS to Vercel. It wasn’t a rewrite: the change was the infrastructure, the deploy pipeline and a move of the localization layer onto Next.js native i18n.

Trippin World’s came down with a rebuilt Next.js static generation pipeline on Vercel. Jamb’s came with a rebuild: two legacy PHP sites became one Next.js and Sanity site.

Fetch content on purpose

Trippin World builds more than 5,000 pages, and every one of them asks Sanity for content. We restructured how content is fetched and cached during the build, so the pipeline stays inside Sanity’s API limits instead of hitting them. The result was zero build failures from API limits.

A build that size also has to survive a missing image or a missing field. Trippin’s build falls back for both, so one bad asset can’t stop the deploy.

Mario Testino’s site had 200% overages on its Sanity plan when we took it over. We stripped the project back to vanilla Sanity, removed the deprecated dependencies and abandoned libraries it had piled up, and rewrote every page, image implementation and data query. The overages went away.

Ship less code

On Tray.ai we moved from styled-components to Tailwind CSS progressively, and added next/link prefetching and next/image. The bundle got smaller, and Vercel Speed Insights scores sit in the high 90s.

Static first holds under load

A page that was built ahead of time doesn’t need a server to answer. Tray.ai’s static-first build served traffic through two DDoS waves with 0% downtime, for a site with more than a million visitors a month.

We also moved half a million pages to Vercel in six weeks, progressively rather than in a single cutover.

Keep the rankings you earned

A faster site that loses its URLs is slower to find. Mario Testino’s previous migration had left more than 160 redirects missing. We fixed every one, cleaned up the navigation so crawlers could read it, and rebuilt the structured data.

When Jamb merged two PHP sites into one, we built a sitemap spanning both, mapped every page into the new site before launch and linked pages through Sanity document references instead of hardcoded URLs. Rankings held through the cutover, and redirects found after launch shipped the same day.

The checklist

  1. Time a full build and a preview build. If a preview needs a production build, fix that first.
  2. Count the content requests a build makes, and cache them so the build stays inside your CMS plan’s API limits.
  3. Give every missing image and missing field a fallback, so one bad entry can’t stop a deploy.
  4. Weigh your component library and styling runtime against the pages that ship them.
  5. Build pages ahead of time wherever the content allows, and render on request only where it can’t wait.
  6. Map every old URL before a migration launches, and watch Search Console the week after.

Sources

  1. Tray.ai case study
  2. Bulletproof case study
  3. Jamb case study
  4. Trippin World case study
  5. Mario Testino case study


The builds behind the numbers




The PDF · All 7 chapters

Keep Fast by default for your next review

The same paper, set for print on A4, with every source linked.

One email with the link, nothing else.


About the authors

Jono Alford

Founder of Roboto Studio, specializing in headless CMS implementations with Sanity and Next.js. A Sanity Pioneer and first-cohort Sanity Community Ambassador, focused on editorial experiences that help teams ship faster.

Hrithik Prasad

Tech Lead with expertise in React, Next.js, and Sanity CMS. Loves building performant web applications and sharing knowledge through technical content.

Sne Tripathi
Sne Tripathi

Account Executive

Account Executive at Roboto Studio, bridging the gap between client needs and technical solutions. Ensures every project delivers real business value.



Get in touch

Tell us what you're building. We reply within one working day. Jono or someone on the team picks up every message personally.

You can also book a call.

By sending this you agree to our privacy policy. We only use your details to reply.