Your Laravel Application Got Slow. What to Measure Before Anyone Touches the Code.
"The site is slow" is the start of a diagnosis, not the end of one. It describes at least three unrelated problems, and the fixes have almost nothing in common. Paying somebody to work on the wrong one is the normal outcome of skipping this step.
Which slow is it?
Slow to appear. You click, and for a couple of seconds there's a blank page or a spinner, then everything arrives at once. The server may well have answered instantly — the delay is in the browser, waiting for something before it can draw anything.
Slow to respond. The page is there, you click a button or submit a form, and it sits. That's the server thinking, and it's usually the database.
Slow under load. Fine most of the time, bad at your busiest hour or during a campaign. That's capacity, and it's the only one of the three a bigger server fixes.
You can tell these apart without any tools. Load a page when the site is quiet and time it. If it's slow then, load isn't your problem, and no amount of extra server will help. Watch whether the page is blank while you wait or already drawn — blank points at the first problem, drawn points at the second.
That five-minute test is the difference between a targeted piece of work and a monthly bill for capacity you weren't short of.
Two kinds of measurement, and why they disagree
Lab data comes from a tool loading your page under controlled conditions. Google's PageSpeed Insights and Lighthouse simulate a mid-range phone on a throttled connection, which is deliberately harsher than the machine you're reading this on. It's repeatable and it tells you what changed.
Field data is collected from the browsers of people actually visiting you. Google publishes it for sites with enough traffic, in the same PageSpeed report, and it's the version that affects search ranking. It reflects your real visitors on their real devices.
They disagree constantly, and neither is wrong. A team testing on office laptops next to the server sees a fast site. Their customers on phones on mobile networks see something else. If most of your traffic is mobile, the lab number is closer to the truth than your own experience is.
One caution from watching our own numbers closely: a single run proves nothing. Some of these metrics move by a couple of points between runs with no change to the site at all — on ours, one of them flaps between 98 and 100 on its own. Take three runs before you believe a regression, and be suspicious of anyone who reports an improvement from one.
The three places our own time went
We did this exercise on this site, and the results are ordinary enough to be useful as a map.
Nothing was drawn until the JavaScript had run. The pages are React, so the browser downloaded the code, executed it, and only then had something to show. On the throttled mobile profile that was roughly three and a half seconds of blank page. The fix was to build the finished HTML at deploy time so the content arrives already drawn — what that involved and what it moved. Mobile performance went from around 85 to the mid-90s.
The same files were being fetched over and over. Browsers cache things they're told to cache, and nobody had told them anything. Our admin panel was rechecking eleven files, about a megabyte, on every page load. The fix was a config file, no application code involved. This is the cheapest performance work that exists and it's routinely the largest single win.
A call to somebody else's server was happening while the visitor waited. Our analytics are sent from our server to Google rather than from the visitor's browser. Originally that request happened during the page request, so every visitor paid for our connection to Google — and if Google were slow that day, they paid more. Laravel can run work after the response has been sent to the browser:
defer(fn () => $this->protocol->send(...));
The visitor's page finishes, then we talk to Google. Same result, none of it on their time. Anything in a request that isn't needed to produce the answer — sending mail, notifying a third party, writing a log somewhere remote — belongs behind this or in a queue.
What a useful answer from your developer sounds like
Ask what specifically is slow, how it was measured, and what the number is now. Then ask what it'll be afterwards, and how you'll both know.
Reasonable answers sound like: "the product listing page takes 2.4 seconds to respond, most of it in a query that runs once per row, and it should be under 300 milliseconds." Specific, measured, checkable when it's done.
Less reassuring: "we'll optimize the code", "it needs a bigger server", "we'll add caching." The third one is a real technique and it's also the standard way to hide a slow query rather than fix it — the query still takes four seconds, it just takes four seconds less often, and now you have cache invalidation to think about too.
There's one answer that should stop the conversation: any quote for performance work given before anything has been measured. Nobody can price a fix for a problem nobody has identified.
Before you spend anything
Load your slowest page when the site is quiet and time it. Run PageSpeed Insights on it three times and write down the mobile score and whether there's field data. Open your browser's network tab, reload twice, and see whether the second load fetches the same files again.
That's twenty minutes, and it's usually enough to tell you which of the three problems you have — which is the part that determines whether you're buying a config change, a few days of query work, or a project.
If you'd rather have somebody else do that and tell you what they found, tell us what you're running. We do performance work on Laravel applications and the custom systems built around them, and it always starts with the measuring.
Frequently asked questions
Why does our site score badly on Lighthouse but feel fast to us?
Lighthouse simulates a mid-range phone on a throttled connection, and you are probably testing on a good laptop with a warm cache near the server. Both are real. If most of your visitors are on phones, the score is closer to their experience than yours is.
Will a bigger server make our application faster?
Only if the current one is running out of something, and most slow applications are not. If the pages are slow when nobody else is using the site, more capacity changes nothing — you would be paying monthly for a fix to a problem you do not have.
How much does it cost to make a Laravel application faster?
It depends entirely on which of the three problems it is. Cache headers are a config change measured in hours. A database query problem is usually days. Changing how pages are rendered is a project. Anyone quoting before measuring is guessing.