Nuxt Performance Optimization: Best Practices and Tips
Nuxt JS performance optimization tips: Nuxt Image optimization and lazy loading, bundle size, minifying JS, caching, and how to measure it.

Nuxt performance optimization is mostly about three things: images, JavaScript and how pages are rendered and cached. Nuxt has tools for all three, but most of them are opt-in. This guide puts the fixes in priority order, shows the code for each, and explains how to measure whether they worked. The examples target Nuxt 4.
Nuxt Performance Optimization: What to Fix First
Start your Nuxt performance optimization with the largest image above the fold, then cut the JavaScript the page ships, then cache what doesn't change per request. Those three hit LCP, INP and server response time hardest, and the first one is usually a one-line change.
| Fix | Metric it helps | Effort |
|---|---|---|
| Size and preload the LCP image | LCP | Low |
| Lazy load images below the fold | LCP, data usage | Low |
| Set width and height on images and embeds | CLS | Low |
| Prerender or cache pages that don't change per request | TTFB, LCP | Low to medium |
| Trim data payloads | TTFB, hydration time | Low |
| Lazy load and lazy hydrate heavy components | INP, JS size | Medium |
| Delay third-party scripts | INP, LCP | Medium |
| Self-host fonts with fallback metrics | CLS, LCP | Low |
Do them in that order unless your measurements point somewhere else.
How to Measure Nuxt Performance
Measure a production build, never the dev server. Run npx nuxt build and npx nuxt preview, or test the deployed site.
For the real picture, open PageSpeed Insights. Its top section shows field data from Chrome users, and that's what Google ranks on. The targets are LCP under 2.5 seconds, INP under 200 milliseconds and CLS under 0.1, measured at the 75th percentile. The Lighthouse report below it is a lab test: useful for finding causes, not for proving a fix worked.
Inside Nuxt, DevTools has a Payload tab that shows how much data each page sends to the client, an opt-in Timeline for component and composable timings, and Build Analyze for comparing bundle reports between builds.
Most of what slows a Nuxt app down at runtime is Vue code, and the same tools apply. Our guide to Vue.js performance optimization covers profiling, reactivity and rendering in depth.
Nuxt Image Optimization
Images are the largest thing on most pages, so Nuxt image optimization usually moves LCP more than anything else. It also fixes a common layout shift: an image without dimensions pushes the content below it down when it loads. Set width and height on every image, and see how to fix CLS for the other causes.
Set Up the Nuxt Image Optimizer
The Nuxt image optimizer is the @nuxt/image module. Install it with npm i @nuxt/image and add it to your config:
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@nuxt/image'],
image: {
quality: 80,
format: ['webp'],
},
})
Then use <NuxtImg> instead of <img>. By default it resizes and converts images with IPX on your own server. On a static build, nuxt generate optimizes the images at build time and saves the results with the site. That's how this site runs: Nuxt Image with the default provider and prerendered pages. If you already use an image CDN, switch the provider and keep the same markup.
Use Modern Formats and Responsive Sizes
Two props do most of the work. format picks the output format, and sizes makes the module generate several widths so phones don't download desktop images:
<NuxtImg
src="/images/team.jpg"
width="800"
height="533"
sizes="100vw sm:50vw md:400px"
format="webp"
alt="The team at work"
/>
For AVIF with a fallback, use <NuxtPicture format="avif,webp">. It outputs a <picture> element with both formats and adds a JPEG or PNG fallback for older browsers.
Two smaller props are worth knowing. densities="x1 x2" serves sharper files to high-density screens without sending them to everyone else. quality trades file size against detail; 75 to 85 is a common range for photos, and this site uses 85 as its default.
Nuxt Image Lazy Loading
Nuxt image lazy loading isn't on by default. With Nuxt Image, you can lazy load anything below the fold by adding one attribute:
<NuxtImg src="/images/office.jpg" width="600" height="400" loading="lazy" alt="Our office" />
Don't do this for the LCP image, the largest one in the first screen. Lazy loading it delays your most important metric. Preload it instead, with a high fetch priority:
<NuxtImg
src="/images/hero.jpg"
width="1200"
height="630"
sizes="100vw lg:1200px"
:preload="{ fetchPriority: 'high' }"
alt="Product dashboard"
/>
This adds a <link rel="preload"> to the page head, so the browser starts the download before it reaches the image in the HTML.
How to Reduce JavaScript in Nuxt
JavaScript has to be downloaded, parsed and run, and while the main thread is busy with it, clicks and taps wait. That wait is what INP measures.
Analyze the Bundle
Start by looking:
npx nuxt analyze
It builds the app and opens reports for the client and server bundles, with every dependency drawn to scale. Look for large libraries pulled into the entry chunk, full builds of date or chart libraries where a smaller import would do, and the same package bundled twice in different versions.
Lazy Components and Lazy Hydration
Add the Lazy prefix to any component and Nuxt loads its code only when it renders. Since Nuxt 3.16 you can also delay hydration, so server-rendered HTML shows straight away but the component's JavaScript runs later:
<template>
<LazyProductReviews hydrate-on-visible />
<LazyNewsletterForm hydrate-on-interaction />
<LazyRelatedPosts hydrate-on-idle />
</template>
The two do different jobs. Lazy splits the component's code into its own chunk, while the hydration props decide when that code runs on a server-rendered page.
hydrate-on-visible waits until the component scrolls into view, hydrate-on-interaction waits for a click, focus or hover, and hydrate-on-idle waits until the browser has nothing else to do. There's also hydrate-never for static blocks that never need JavaScript. A good rule: anything below the fold that isn't needed for the first interaction can wait.
Nuxt Minify JS: What the Build Already Does
You don't need a plugin for Nuxt minify JS. A production build already minifies JavaScript and CSS, removes unused exports, and splits code so each page loads its own chunk. On Nuxt 4.5 and later, which build with Vite 8, the JavaScript minifier is Oxc and CSS goes through Lightning CSS.
What's left is up to you. Minification can't remove a library you import but barely use, code that runs on every page from a global plugin, or a component imported eagerly when it's needed on one route. Those are what nuxt analyze is for.
Nuxt JS Performance Optimization: Rendering and Caching
The biggest Nuxt JS performance optimization is often not rendering the same page twice. If you're new to Nuxt's rendering modes, What is Nuxt explains them. Route rules let you choose per path:
// nuxt.config.ts
export default defineNuxtConfig({
routeRules: {
'/': { prerender: true },
'/blog/**': { swr: 3600 },
'/products/**': { isr: 600 },
'/dashboard/**': { ssr: false },
},
})
Prerendered pages are built once and served as files. swr caches the server response and refreshes it in the background after an hour. isr does the same on the CDN, on hosts that support it, such as Vercel and Netlify. ssr: false turns a section into a client-rendered app, which is fine behind a login and costly anywhere search engines or first-time visitors land.
Prerendering is the fastest option when it fits. This site prerenders every page with nuxt generate, so each request is a static file from the CDN with no server work at all. It fits any page whose content changes on publish rather than per visitor.
Slow APIs can be cached on the server too:
// server/api/products.get.ts
export default defineCachedEventHandler(async () => {
return await $fetch('https://api.example.com/products')
}, { maxAge: 60 * 10 })
Last, watch the payload. Whatever useFetch returns on the server is serialized into the page for hydration, so send only what the template uses:
const { data: products } = await useFetch('/api/products', {
transform: items => items.map(({ id, title, price }) => ({ id, title, price })),
})
For a single object, the pick option does the same with a list of keys. Nuxt 4.6 also warns in development when a page's payload goes over 100 kB.
Fonts and Third-Party Scripts
Web fonts delay text and shift the layout when they swap in. The @nuxt/fonts module downloads fonts at build time, serves them from your own domain with long cache headers, and generates a fallback font sized to match, so the swap barely moves anything. We use it on this site for Manrope.
Third-party scripts such as analytics, chat and video embeds are often the heaviest JavaScript on a page, and you don't control them. @nuxt/scripts loads them after hydration by default, can wait for cookie consent or for an element to scroll into view, and ships facade components. <ScriptYouTubePlayer> shows a thumbnail and loads the YouTube player only when someone interacts with it.
Conclusion
Check field data first, then work down the list: the LCP image, JavaScript, caching, fonts and scripts. Re-measure after each step, not at the end, so you know which fix did the work.
If your scores still won't move, our Vue and Nuxt performance optimization services find the bottlenecks, rank them by expected impact and implement the fixes in your codebase. For new builds and upgrades, see our Nuxt development services.
FAQs
Does Nuxt Image lazy load by default?
No. NuxtImg renders a normal img tag, and you opt in with loading="lazy". That's deliberate, because the largest image above the fold should load as early as possible, not wait for the browser to decide it's visible.
Does Nuxt Image work with a CDN?
Yes. Nuxt Image ships with providers for more than 40 image services and CDNs, including Cloudinary, Cloudflare, imgix, Vercel and Netlify, and it detects Vercel, Netlify and AWS Amplify automatically. You keep the same NuxtImg markup and the provider builds the URLs.
How do I reduce Nuxt bundle size?
Run npx nuxt analyze to see what's in each chunk, then replace or lazy-load the biggest dependencies. Use Lazy components and lazy hydration for anything below the fold, and load third-party scripts through Nuxt Scripts instead of plugins.
Does SSR make a Nuxt app faster?
It makes the first view faster, because the browser gets finished HTML instead of an empty page and a bundle to run. It doesn't make interactions faster, and a slow server can cancel the gain, so cache or prerender pages where you can.
Is Nuxt faster than plain Vue?
For public pages, usually yes on first load, because Nuxt sends server-rendered or prerendered HTML while a plain Vue SPA renders in the browser. After that both run the same Vue runtime, so interaction speed depends on your code, not the framework. Our Nuxt vs Vue comparison covers the rest of the difference.
Does upgrading to Nuxt 4 improve performance?
Mostly in development: Nuxt 4 starts faster and shares data between components that use the same key. Production speed depends more on your images, JavaScript and caching. The stronger reason to upgrade is support, since Nuxt 3 reached end of life on 31 July 2026. Our Nuxt 4 migration guide walks through the changes.
When does a Nuxt app need a performance audit?
When Core Web Vitals fail in field data, when conversion drops on mobile, or before a big redesign or migration. An audit is also worth it when the team has tried the obvious fixes and scores still don't move. Our Vue and Nuxt code audit covers performance alongside code quality.
Vue.js is our passion. Open Source is our culture 😍