A thirty-five minute build does not feel like a technical problem. It feels like waiting. But the people waiting are the ones who want to ship, and every one of them has decided - consciously - to do something else instead. The pipeline is not just slow. It is quietly spending the team's attention.
On the HPP platform I took the build from roughly 35 minutes to 5-8. Here is the order I do it in, because the order is the point.
Day one: read it before you touch it
Nobody can fix a pipeline they have not read. I start by running the pipeline and writing down every stage, how long it takes, and what it actually does. Not what the YAML implies - what it does on a cold cache, on a warm cache, and on a branch with one commit on it.
The three numbers that matter: time to first result, time to full result, and how much of the total is waiting on a network rather than on a machine.
Day two: the four changes that usually pay
Cache what does not change. Package and dependency caches are the difference between 35 minutes and 5 in most pipelines. If your build installs the same dependencies on every commit, that is not a pipeline, that is a ritual.
Move the runtime forward, then say so. Modernising the frameworks and the runtime on HPP was not a fashionable upgrade; it was a move to versions that are still supported, with the security fixes that come with them.
Take the weight out of the repository. Trimming 100MB+ from the repository made clones and checkouts meaningfully faster.
Do not install what you do not use. Moving the pipeline to pnpm, with the store cached between builds, removed installs that were pure overhead.
Then the parts people argue about
The image strategy and the caching layers are where the last minutes live. NuxtImg/IPX, a Vercel image strategy and Redis-plus-Array caching held the same pages at Lighthouse 95+ on desktop and 85+ on mobile, with 0 poor-URLs in the CrUX 28-day window.
Those numbers are the outcome, not the method. The method was: change one thing, measure, keep it or revert it.
The part that keeps the gain
The last thing I do is write the release gates so they fail the build instead of failing the customer, and leave a written release process behind. A pipeline that nobody understands will drift back to thirty-five minutes, usually without anyone deciding to.
What I would not do
I would not split a pipeline into a web of smaller ones to make the badge green. If the total time to ship is the same, the complexity is not a win. And I would not optimise the stages nobody waits for - some slow step at 3am nobody reads is not a problem, it is just a slow step.
Build time is a number. What you are actually buying is the team's willingness to ship again before lunch.