FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
7 Next.js Performance Optimizations That Took Our Site from 55 to 94 on PageSpeed
NewsWeb Development

7 Next.js Performance Optimizations That Took Our Site from 55 to 94 on PageSpeed

via Dev.to WebdevShota Sabashvili3h ago

Last month, our agency website scored 55 on Google PageSpeed Insights (mobile). Today, it scores 94 on desktop and 78 on mobile — and we're still pushing higher. Here are the 7 changes that made the biggest difference, with actual code you can copy into your Next.js project today. 1. Lazy Load Third-Party Scripts (GTM, Analytics, Chat Widgets) This single change gave us the biggest performance jump. Google Tag Manager alone was loading 250KB of JavaScript on page load — most of it unused. Before: GTM loads immediately, blocking the main thread. // layout.tsx — DON'T do this import { GoogleTagManager , GoogleAnalytics } from ' @next/third-parties/google ' export default function Layout ({ children }) { return ( < html > < GoogleTagManager gtmId = "GTM-XXXXX" /> < body > { children } </ body > < GoogleAnalytics gaId = "G-XXXXX" /> </ html > ) } After: GTM loads 3 seconds after page load or on first user interaction — whichever comes first. // components/Analytics.tsx ' use client ' impor

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
0 views

Related Articles

Misadventures in Agent sitting
News

Misadventures in Agent sitting

Medium Programming • 25m ago

Your Senior Engineers Are Just Googling Shit (And That’s Why They’re Better Than You)
News

Your Senior Engineers Are Just Googling Shit (And That’s Why They’re Better Than You)

Medium Programming • 32m ago

News

---

Medium Programming • 57m ago

News

When Vibe Coding Goes Wrong: The Invisible Debt of Shipping Fast

Medium Programming • 2h ago

Mediator Design Pattern Made Ridiculously Simple — The Easiest Explanation You’ll Ever Read
News

Mediator Design Pattern Made Ridiculously Simple — The Easiest Explanation You’ll Ever Read

Medium Programming • 2h ago

Discover More Articles