Before you upgrade your server, check these three.
A lot of Next.js speed problems live in the front end, not the hosting. The page feels slow because the browser has to download too much, wait on fonts, decode large images, and parse JavaScript it doesn't need yet. A bigger server will not shrink a 3 MB hero image. It will not stop a layout from jumping when a web font arrives. It will not keep a charting library out of the first load.
We keep a short performance pass for Next.js apps. It is not a full Core Web Vitals audit, and it isn't a promise about scores. It's three places that go wrong often, and three built-in tools that fix them: next/image, next/font, and dynamic imports for heavy components below the fold.
The hosting upgrade that doesn't fix the page
When a site feels slow, "we need better hosting" is a comforting diagnosis. It sounds like a purchase will solve it. Sometimes hosting really is the issue: a cold serverless function, a region far from your users, an API that waits on a slow query. Those are worth measuring.
But measure the front end first, on a mid-range phone, on mobile data — the same condition a real visitor is in. Open the Network panel. Look at the weight of images and JavaScript. Look at whether the largest element on the first screen is a giant PNG. Look at whether the text is invisible or jumps while fonts load.
If the first screen is heavy before your own API has even answered, you do not have a server problem yet. You have a page problem.
1. Images: use next/image, and stop shipping huge files
Images are the most common way a Next.js site gets heavy. A designer exports a 2400-pixel PNG. It goes in the hero. It looks sharp on a studio monitor. On a phone, the browser downloads the whole thing, then scales it down.
next/image helps in three practical ways. It serves modern formats like AVIF and WebP when the browser can use them. It sizes the file to the layout you actually rendered, instead of the original. And it can wait to load images that are off-screen, so the first screen isn't competing with a section further down the page.
The component isn't magic. You still need to give it a sense of size so the page doesn't jump, and you should not use it as a way to ignore compression. Start with the source: crop to what you show, export at a sensible resolution, and prefer a photograph or UI screenshot that is already lean. Then let next/image handle the variants.
A few habits we use:
- Be careful with priority on above-the-fold images — the main hero can be eager; the rest should not.
- Don't use a video background if a still would do.
- Remote images need to be allowed in the Next.js config, or they can stay huge — or fail quietly.
- Check the Network tab after you "optimize." Confirm the request is actually a smaller modern format, not the original file with a prettier component around it.
2. Fonts: use next/font, and keep the family short
Fonts are a quieter source of slowness, and of layout shift. The page renders in a fallback. Then the custom face arrives, and every headline moves. Or the text stays invisible until the font is ready, and the first screen looks empty for a beat too long.
next/font is the default we want in a Next.js app: it self-hosts the files, sets them up so the browser can use them efficiently, and makes it much easier to avoid a flash of unstyled or invisible text. You don't need a third-party font CDN for a couple of weights of one family.
Keep the family short. One sans for UI, maybe one for a distinct heading if you truly need it. Each weight is a file. If you load 300, 400, 500, 600, 700, and 800 because the design file had them, you are paying for a typographic range visitors will not notice. Pick the weights you actually use.
Also match the fallback. If your UI font is a geometric sans, don't let the fallback be a wide serif system face that makes the layout jump when the real font arrives. next/font can help with size-adjusted fallbacks. The goal is simple: the page should be readable immediately, and it should not lurch when the brand font lands.
3. Dynamic imports for heavy components below the fold
The third leak is JavaScript you don't need on the first screen.
A marketing page pulls in a full page-builder animation. A dashboard imports a chart library, a rich text editor, a map, and a date library — all in the first bundle — even though the editor is behind a click and the map is at the bottom. The user wanted a heading, a button, and maybe a table. They paid for everything else first.
Dynamic import() (and next/dynamic) lets you load a component when it's needed: when it scrolls into view, when a tab opens, when a route is actually visited. The first paint can stay about the page, not about the heaviest widget on it.
We use this for:
- Charts and data visualizations
- Maps
- Rich text or code editors
- Heavy animation or 3D
- Modals and drawers that aren't part of the first view
- Analytics or chat widgets that can wait a moment
Don't dynamically import everything. The goal is not a forest of split points. The goal is to keep the first screen's JavaScript close to what the first screen needs. If a component is small and always visible, leave it in the main path.
After you split, check the result. Confirm the heavy library is no longer in the initial script. Confirm the delayed component still appears when it should, with a sensible loading state — a reserved height, a skeleton, a "charts loading" label — so the page doesn't jump or look broken.
A short performance pass you can do this week
You don't need a two-week performance project. You need an afternoon and a device that isn't your development laptop.
- Open the production page on a mid-range phone, on mobile data. Watch the first screen. Time-to-feeling-usable matters more than a single score.
- In the Network panel, sort by size. Find the largest images and scripts.
- Replace raw
<img>tags in the product path withnext/image, and shrink the sources that are obviously oversized. - Move custom fonts to
next/font. Drop unused weights. - Find the heaviest interactive component below the fold and load it dynamically.
- Recheck the same phone, on the same kind of connection.
If the page is still slow after that, then look at the server: data fetching, caching, query shape, region, and whether you are rendering too much on every request. That work is real. It is just not the first place we look.
What this doesn't cover
This pass will not fix a slow API, an uncached server render, or a third-party script you cannot control. It will not replace measuring real users when you have them. And you still have to be deliberate about client components, what you fetch, and what you send down.
The three fixes are still the right start. They are built in, they are reversible, and they address problems we see even on carefully designed sites.
Takeaways
- Don't upgrade hosting until you've looked at the front end on a mid-range phone, on mobile data.
- Use
next/imagewith reasonably sized sources, AVIF/WebP, and lazy loading below the fold. - Use
next/font, self-host, and load only the weights you actually use, so text doesn't jump or disappear. - Dynamically import heavy components — charts, maps, editors, motion — that aren't needed for the first screen.
- Confirm the Network tab after you change things. The component is not the proof; the smaller request is.
- If it's still slow, then look at data, caching, and the server.
Save this for your next performance pass.
We're nothink, a small team that designs and builds products for startups — more at nothink.site.
Top comments (0)