Case Study

From 21 MB to 1 MB: speeding up a restaurant-technology marketing site on Next.js and Sanity

A Next.js and Sanity marketing site was serving original-size CMS images. Moving them through Sanity's image pipeline cut the homepage from 21 MB to about 1 MB and mobile LCP from 29 s to 3 s in lab tests.

Client
A restaurant-technology platform (name withheld)
Industry and market
Restaurant and hospitality technology, United States
My role
Senior Web Developer (employer work, 2026): performance and front-end rebuild of the marketing site
Duration
2026
Stack
Next.js (App Router), React, Sanity, AWS CloudFront, Google Tag Manager

The business problem

A restaurant-technology company sells a platform that ties online ordering, loyalty and kitchen systems together. Its marketing site is where restaurant operators decide whether to talk to sales, and operators often look at it on a phone. The homepage was heavy: in lab tests it transferred about 21 MB and took around 29 seconds to show its main content on a throttled mobile connection.

The technical challenge

The site was already built on Next.js with Sanity as its CMS, so the problem was not the framework. Almost all of the weight was images: originals uploaded to the CMS at up to 4,320 pixels wide were being delivered as they were. On top of that the page preloaded eight images at once, which made them compete with the hero, referenced six font files, and left sixteen images without alt text.

What I did

  • Delivered every CMS image through Sanity’s image pipeline (resized to the size shown, converted to a modern format), instead of the original files.
  • Lazy-loaded everything below the fold: from 7 to 23 of the page’s 29 images.
  • Removed the competing preloads from the page head so the hero image loads first.
  • Trimmed fonts: two preloaded font files instead of six referenced.
  • Added alt text to every image, which also fixed the accessibility and image SEO audits.
  • Converted the static case-study image from a 626 KB PNG to an 86 KB WebP.

Results

Measured with Lighthouse 12.8 on 3 October 2026, comparing the optimized build on the staging environment with the production build at the time (mobile: median of three runs). The staging build does not load the analytics tag manager that production does, which adds a little to production’s numbers; the image weight difference is far larger.

  • Page weight: 21.3 MB to 1.1 MB; requests: 88 to 50.
  • Mobile LCP (when the main content appears): 29.2 s to 3.0 s; desktop LCP: 6.0 s to 1.4 s.
  • Mobile Performance score: 67 to 92; desktop: 73 to 94.
  • Accessibility score: 80 to 100 (mobile).
  • In PageSpeed Insights (desktop, 2 October): Performance 76 to 96, LCP 4.0 s to 0.9 s.

These figures are lab results on the staging build; I will update this page with real-user and production numbers once the optimized build is serving production traffic.

What I would do next

Use a single H1 per page, add a canonical tag and structured data, and cache the mostly static marketing HTML at the CDN so visitors are not served a fresh server render on every request.

Is your Next.js or WordPress site heavier than it should be?

Most slow sites are slow for one or two fixable reasons. A technical assessment finds them. See also Next.js development.

Related services

Facing something similar?

Send me the link and a few lines. I reply within one business day with a clear next step.

Tell me about your site

Share the constraints, launch pressure, and technical scope.

  • Current stack or platform
  • Key integrations or APIs
  • Timeline and delivery constraints
  • The highest-risk technical unknown
Prefer a call or WhatsApp? Add your number (optional)