100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Next.js App Router
30 minintermediate

Image, Font and Asset Optimisation

Images and fonts are usually the heaviest things a web page loads, and handled naively they are also where the most damaging performance and user-experience problems originate: oversized images that waste bandwidth and slow the first paint, layout that jumps as images and fonts arrive at unpredictable sizes, and render-blocking font requests that leave text invisible or restyled mid-load. The App Router ships with purpose-built tools for these exact problems — the next/image component for images and the next/font system for fonts — plus conventions for static assets, and together they convert a category of error-prone manual optimization into framework defaults. Using them is not a micro-optimization; it directly affects the Core Web Vitals metrics that determine both perceived speed and search ranking.

The reason this topic deserves real attention rather than being treated as cosmetic is that asset handling is where good intentions most often fail silently. A developer drops in a high-resolution image straight from a camera, and it looks fine on their fast connection and large screen, so the problem is invisible to them — but a user on a phone over a slow network downloads several megabytes for an image displayed at a fraction of its size, and the page that felt instant to the developer crawls for the user. Fonts cause an equally subtle issue: a custom font fetched from a third-party server adds a render-blocking request and, depending on loading strategy, either hides text until it arrives or flashes a fallback that then shifts to the custom font, jolting the layout. The framework's image and font tools exist precisely to make the fast, stable path the default path, so that doing the straightforward thing produces optimized, layout-stable results rather than the slow, jumpy ones that naive handling yields. Understanding what these tools do and why is what lets you ship pages that are fast for real users on real devices, not just on your own machine.

Analogy🏏Cricket
🏏 Think of it like cricket: Picture a Test match where, before the openers walk out, the curator has already prepared the pitch, the umpires are positioned, and the scoreboard is live — the players just play. Plain React is like arriving at an empty ground and being told to roll the pitch, set the field, and wire up the scoreboard yourself before a single ball is bowled. Just as the prepared ground lets the batsmen focus on batting rather than groundskeeping, Next.js prepares routing, rendering, and bundling so you focus on features rather than plumbing. Just as the live scoreboard shows runs the instant a shot is played, server rendering hands the browser finished HTML the instant the page loads. And just as every Test follows the same agreed laws so any team can play anywhere, the App Router's file conventions mean any developer can read the folder structure and instantly know the routes. This reveals why Next.js wins on large teams: shared conventions remove the guesswork that custom setups create.
Lesson 21 of 35
0% complete