Pages

▼

Web Performance & CDNs

🧑🏻‍🎓 AL Academy Masterclass

Web Performance & CDNs

Performance is a feature, not a finish line. Here is how to think about speed across the whole stack, from the first byte to the nearest edge.



The four-second problem

Every site has an invisible audience: the people who arrived, waited, and left before they ever saw your content. They do not show up in your engagement charts because they never engaged. They show up only as the gap between the traffic you paid for and the traffic that converted. That gap is, more often than anyone wants to admit, a performance problem.

We have known this for a long time, and yet performance keeps slipping. The reason is structural. Speed is the one feature that nobody owns and everybody erodes. A designer adds a hero video. A marketer adds three tracking scripts. A developer pulls in a convenient library that drags forty kilobytes of dependencies behind it. Each decision is individually reasonable and collectively fatal. By the time anyone notices, the page weighs four megabytes and the team is arguing about whether users "really" care about speed. They do. They just express it by leaving.

Measure like a scientist, not an optimist

The first discipline of performance is honest measurement, and the most common failure is measuring the wrong thing. A developer runs a test on a high-end laptop on office fibre, sees a fast result, and declares victory. Meanwhile a real user on a three-year-old phone over a congested mobile connection is staring at a blank screen.

This is why the industry separates lab data from field data. Lab data, from tools like Lighthouse, is synthetic and reproducible: it is how you debug, because you can change one thing and see the effect cleanly. Field data, gathered from real users, is how you learn the truth, because it reflects every device and network you do not own. You need both, and you need to read them at the 75th percentile, not the median. Optimizing for the median means accepting that a quarter of your users have a bad time, which for any site of size is a very large number of unhappy people.

The Core Web Vitals give this a shared vocabulary. Largest Contentful Paint asks: when does the main content actually appear? Cumulative Layout Shift asks: does the page hold still, or does it jump around and make me tap the wrong thing? First Input Delay asks: when I finally interact, does the page respond? Together they describe the felt experience of a page far better than any single "load time" number ever did. And a new metric, Interaction to Next Paint, is on the horizon to capture responsiveness more completely. It is still experimental as I write this, but it points clearly at where the standard is heading: toward measuring not just how fast a page arrives, but how good it feels to use.

Shorten the path before you widen the road

Once you can measure, the work itself follows a simple logic: send fewer bytes, send them later if you can, and send them from closer.

Sending fewer bytes is unglamorous and enormously effective. Images are the heaviest thing on the median page, so modern formats, correct sizing, and responsive markup deliver the biggest single win available to most teams. JavaScript is the next offender, not just because of its weight but because it blocks the main thread while it runs. Deferring scripts off the critical rendering path is often the difference between a page that feels instant and one that feels stuck.

Sending bytes later means understanding the critical rendering path: the precise sequence a browser must complete before it can paint. Anything render-blocking or parser-blocking sits directly in that sequence. Inline the critical CSS, defer the rest, and the first paint arrives sooner with no change to the total work, only its order.

Sending bytes from closer is where caching and content delivery networks come in. The fastest request is the one that never leaves the device, which is what good cache headers buy you. The next fastest is the one answered by an edge server a few milliseconds away instead of an origin across an ocean, which is what a CDN buys you. A CDN is not a magic fix; it is a multiplier. It cannot un-bloat your page, but it can take an already-lean page and deliver it at the same speed to Lagos, Lima, and Lyon. Optimize first, then let the edge amplify the result.

The whole stack, or none of it

It is tempting to treat performance as a front-end concern, but a slow back end undermines everything. If your server takes a full second to produce the first byte, no amount of image compression will rescue the experience. Time to First Byte is where database indexes, query patterns, and caching layers quietly decide your fate. Compression and modern protocols like HTTP/2 and HTTP/3 then govern how efficiently those bytes travel. Performance is genuinely a whole-stack discipline, and the bottleneck moves: fix the images and suddenly the back end is the limit; fix the back end and suddenly the third-party scripts are.

Make speed a ratchet, not a sprint

The hardest part of performance is not achieving it but keeping it. This is what a performance budget is for. A budget is a set of limits the team agrees on and enforces automatically: a maximum JavaScript size, a maximum total weight, a maximum LCP. Wire it into your continuous integration so a pull request that blows the budget fails the build, exactly like a failing test. The budget turns speed from something a hero occasionally fixes into a property the system defends on its own.

That is the real shift in mindset. Performance is not a project with an end date. It is a feature you ship and then protect, every single deploy, because the four-second problem never stops trying to come back.

This article accompanies the free Web Performance & CDNs masterclass at AL Academy. Workshop, PDF handbook and curated resources: alouatiq.com/academy.
web-performancecore-web-vitalscdncachinglighthouse

No comments:

Post a Comment