Deferring Render-Blocking Scripts: How My Calculator Site Hit 99 on Desktop PageSpeed

When I first ran PageSpeed on my calculator site, the desktop score was fine but the report kept flagging the same thing: render-blocking scripts. Every calculator page loads a few JavaScript files, and the browser was waiting on them before it painted anything. The page was simple — a form, some inputs, a result box — yet the first paint was slower than it had any right to be. Here is what I actually changed, and what each change was worth. The problem was order, not size My first instinct was to shrink the scripts. That helped a little, but the real problem was order. The browser reads a page top to bottom, and a normal in the head stops everything until the file downloads and runs. My calculator logic does not need to run before the page shows up — nobody can type hours into a form that has not rendered yet. So the scripts were blocking a render they did not need to be part of. The fix was the defer attribute on every script tag that touches the page after load:

Deferring Render-Blocking Scripts: How My Calculator Site Hit 99 on Desktop PageSpeed

When I first ran PageSpeed on my calculator site, the desktop score was fine but the report kept flagging the same thing: render-blocking scripts. Every calculator page loads a few JavaScript files, and the browser was waiting on them before it painted anything. The page was simple — a form, some inputs, a result box — yet the first paint was slower than it had any right to be. Here is what I actually changed, and what each change was worth.

The problem was order, not size

My first instinct was to shrink the scripts. That helped a little, but the real problem was order. The browser reads a page top to bottom, and a normal

Deferred scripts download in parallel with the HTML and run only after the document has finished parsing, in the order they appear. That one attribute is the whole trick for most of my pages. It is not the same as async: async scripts run the moment they arrive, in whatever order they finish, which is fine for analytics but wrong for scripts that depend on each other. My calculator files share functions, so order matters, and defer keeps it.

What stayed in the head

Not everything moved. A tiny inline script that sets the theme and the year in the footer stayed where it was, because it is a few lines and it prevents a flash of the wrong layout. Anything that small is not worth deferring — the cost of the extra round trip would be worse than the few milliseconds it blocks. The rule I ended up with is simple: if a script touches the page before the user can see it, it stays; everything else gets defer.

CSS was blocking too

Scripts were the loudest complaint, but the report also flagged the stylesheet. A calculator page needs its CSS before first paint, so I could not defer it the same way — an unstyled flash on a form page looks broken. What I could do was shrink it. The site uses one shared stylesheet driven by CSS variables for the deep green theme, so there was no per-page CSS to split out. I removed the rules that no page used any more, inlined the handful of critical rules for the header and the first calculator card, and let the rest load normally. The stylesheet went from something I was slightly embarrassed about to a file I could defend.

Measuring, not guessing

After each change I re-ran the test on the same page, on desktop, three times, and took the middle result. Deferring the scripts was the biggest single jump. Trimming the CSS was smaller but real. The lesson that stuck with me is that performance work on a small site is mostly about removing work the browser does not need to do yet, not about clever optimisation. A calculator page has no images to lazy-load and no framework to tree-shake — it just has a form, some logic, and a stylesheet. Getting those three things in the right order was most of the job.

The site this ran on is mytimecardcal.com, a set of pay calculators I build and maintain myself. If you run a small tools site, open your own PageSpeed report and look at the render-blocking list first. It is usually the cheapest win on the page, and it is a one-word fix per script tag.