Skip to main content
Back to Insights & Guides
Web DevelopmentOctober 2026•7 min read

Next.js 14 Performance Blueprint: How We Cut Homepage JavaScript 41% (385 kB to 227 kB)

The exact changes we shipped on our own site: lazy-loading the 3D stack, deleting paint-heavy blur effects, and keeping motion on the GPU — with the real before/after build numbers and their limits.

AX
Axioms Lab Team
Full-Stack Web Development

Website speed directly impacts conversion rates and search rankings. A visually impressive site that takes four seconds to become interactive loses visitors before they ever read your headline.

Keep Heavy Logic on the Server & Motion on the GPU

By rendering static marketing and content sections with Next.js Server Components and animating only GPU-composited properties (transform and opacity), you preserve silky 60fps scrolling even on mid-range mobile devices.

  • Use React Server Components by default to minimize client JavaScript bundles.
  • Self-host variable or subset fonts to eliminate external layout shifts.
  • Animate transform and opacity rather than layout-triggering width or top properties.

Make the 3D Library a Lazy Async Chunk

Our homepage hero renders a WebGL particle sphere with three.js. Statically imported, that put the entire 3D stack on the critical path of every hard load. We switched the hero canvas to next/dynamic with ssr: false so three.js ships as a separate async chunk, and held the layout with a lightweight CSS radial glow that fades out when the canvas arrives. Server-rendered HTML stays complete for crawlers and first paint; the 3D layer enhances afterwards.

  • Heavy visual libraries belong behind dynamic imports, not static ones.
  • Reserve space with CSS so lazy layers never shift layout.
  • Respect prefers-reduced-motion by skipping the canvas entirely.

Delete Paint-Heavy Effects Before Optimising Anything

Entrance animations that animate filter: blur() force the browser to repaint large regions every frame. Replacing them with compositor-only properties (transform and opacity) removed that per-frame paint cost across the landing page. Combined with the chunk split above, our home route's first-load JavaScript fell from 385 kB to 227 kB in the next build output — a real, repeatable lab number from our own repository.

  • Audit animations for layout- and paint-triggering properties first.
  • Measure with build output before and after; guesswork wastes sprints.
  • Code-split per route so below-fold sections pay their own way.

Know What Your Numbers Are — and Are Not

First-load JavaScript size is a lab metric: reproducible, but blind to real networks, devices and caching. Core Web Vitals from real users (field data) is what Google actually weighs, and we do not yet have enough traffic to publish it honestly. Until we do, we label every figure on this site as a target or a lab result — and we suggest you hold any agency, including us, to the same standard.

  • Label every published metric as target, lab result, or field data.
  • Ship RUM (real-user monitoring) before claiming Core Web Vitals wins.
  • Absence of field data is not a failure; hiding that absence is.
High performance isn't an afterthought plugin—it is the result of disciplined architecture from the very first component. One honest caveat: the 385 kB to 227 kB figures above are first-load JavaScript sizes from our own next build output (a lab measurement on one route), not field data from real users, and a Lighthouse score on your machine will vary with device, network and extensions. Treat the numbers as direction, not a promise — and if you want this discipline applied to your own site, see our web development service.

Related service: Web Development at Axioms Lab

WORK WITH AXIOMS LAB

Want this built for your website or product?

Speak directly with our designers and engineers in Kuopio & Lahore to scope your build.

Explore our Web Development services
Start Your Project

Continue Reading