Web performance is one of those subjects where it is easy to become preoccupied with numbers. We run a test, receive a score and start looking for ways to make it higher.
There is some value in that, but the score isn't really what matters. What matters is how quickly somebody can start using a website, how reliably it responds and whether the experience remains consistent on the devices and connections people actually have.
A website can achieve an impressive result in a controlled test and still feel slow in everyday use. Equally, a less impressive score doesn't necessarily mean that an application is difficult to use. Understanding the difference is where performance engineering becomes useful.
Start with the experience
Before making changes, I think it helps to establish what people are trying to do.
Somebody reading an article wants the content to become available quickly and remain stable as they scroll. Somebody using a business application may be more concerned with the delay between submitting a form and seeing the result. A booking system needs to remain responsive while availability and pricing are being updated.
These are quite different problems, even though all three might be described as a slow website.
It is also worth distinguishing a first visit from a returning one. A returning visitor may already have scripts, stylesheets and images cached. Somebody arriving for the first time on a mobile connection could be downloading everything from scratch.
The aim should be to improve the experience that matters for the application, rather than optimising whichever number is easiest to measure.
Measure what people actually experience
Browser developer tools and services such as Lighthouse are useful for investigating performance. They can identify large resources, unnecessary JavaScript, slow responses and rendering work that might otherwise be difficult to spot.
However, these are largely controlled measurements. They tell us how a page behaved under particular conditions, not necessarily how it performs for everybody using it.
Field data offers another perspective. It describes what happens on real devices and connections, where the differences between a modern laptop and an older mobile phone can be considerable.
The Core Web Vitals provide a useful starting point:
- Largest Contentful Paint (LCP) helps indicate when the largest visible content element has finished rendering.
- Interaction to Next Paint (INP) measures responsiveness across interactions, revealing interfaces that appear ready but take too long to react.
- Cumulative Layout Shift (CLS) captures unexpected movement, such as content shifting just as somebody tries to press a button.
These metrics don't cover every aspect of performance, but they encourage us to think separately about loading, responsiveness and visual stability.
I would use both laboratory testing and field measurements where possible. The former helps reproduce a problem; the latter helps establish whether people are actually experiencing it.
Find the bottleneck before changing the architecture
A slow page doesn't automatically need a faster server, a content delivery network or a different frontend framework.
Sometimes the problem is a large image that has never been resized. Sometimes the application makes more database queries than necessary. In other cases, the browser is spending too much time executing JavaScript.
It is worth following the request through the system. How long does the server take to respond? Are database queries holding things up? How much data is transferred? When does the browser discover the resources it needs? Is it waiting for scripts to execute before showing useful content?
For a Laravel application, eliminating an N+1 query problem or reducing unnecessary work during a request may have a greater effect than changing how the frontend is rendered.
On a public-facing website, correctly sized images and fewer blocking resources might make the most noticeable difference.
The important thing is to establish where time is being spent before choosing a solution.
Images, fonts and JavaScript all have a cost
Modern websites tend to accumulate resources gradually. A new font weight is added, an analytics script is introduced, or an image is uploaded directly from a camera. Each decision can seem insignificant on its own.
Together, they can make a website noticeably heavier.
Images should be delivered at an appropriate size and in a suitable format. Responsive image markup lets the browser select a file appropriate to the display instead of downloading a large desktop image on a phone. Images below the fold can often be loaded lazily, while important content visible immediately may need to be prioritised.
Fonts deserve similar attention. Loading several families and weights increases the amount of data required before the page looks as intended. It may also affect how text appears while those files are loading.
JavaScript is particularly easy to underestimate. Download size is only part of the cost: the browser must also parse and execute it. A large script may be insignificant on a powerful laptop but cause noticeable delays on a less capable device.
I prefer to begin with what the interface genuinely needs. Additional libraries and third-party scripts should justify the work they introduce.
The backend still matters
Frontend optimisation cannot compensate for an application that consistently takes too long to produce responses.
Database indexing, query design, caching and external service calls are all part of web performance. So is the way work is scheduled.
An operation such as sending an email or generating a report often doesn't need to hold up the response to a user's request. Moving suitable work into a queue can let the application respond sooner while the operation continues separately.
However, queues introduce their own responsibilities. Jobs can fail or become backlogged, and users may need to know when an operation has finished.
Caching also requires some thought. It can avoid repeated work, but it raises questions about expiry, invalidation and whether content is specific to an individual user. Serving an incorrect or outdated result quickly isn't necessarily an improvement.
Performance needs to be considered alongside correctness and reliability.
Keep performance from deteriorating
Performance rarely becomes a problem all at once. More often, a website gets a little heavier with each release until somebody notices.
A simple performance budget can help. We might monitor the amount of JavaScript delivered initially, track important page timings or check whether a new feature significantly increases the work required to load a page.
Not every project needs an elaborate monitoring platform. Even repeatable testing of a few representative pages, including on slower devices, can reveal changes before they become serious.
It is also important to test actual tasks rather than only the homepage. The slowest part of a business system might be a report, a complex form or a table containing more records than anticipated.
When improvements are made, measure again. Otherwise it is difficult to know whether the change helped or simply moved the work elsewhere.
Performance is an ongoing design decision
There isn't a single technique that makes every website fast.
Server-side rendering can improve the initial presentation of content, but it doesn't remove the cost of slow server responses. Caching can reduce repeated processing, but needs a sensible invalidation strategy. A sophisticated frontend can provide an excellent experience, provided we remain conscious of what it asks the browser to do.
I think the most useful approach is to make performance part of ordinary development rather than treating it as a separate exercise immediately before launch.
Measure the experience, identify the real constraints and make improvements that can be verified. The objective isn't a perfect score. It is a website or application that feels dependable and responsive for the people using it.