001 Speed

One script cost our homepage 1.5 seconds

A bot check at the foot of a long page delayed the top of it. What loading order costs on a phone, and the measurement that settles the argument.

Our homepage carries one third-party script: a bot check that protects the contact form at the very bottom of the page.

Loaded the normal way, it cost 1.5 seconds before the top of the page finished drawing, and dropped the page’s performance score from 100 to 93. Measured both ways, on a simulated phone.

The form it protects is below several screens of content that most visitors never scroll to.

Why the bottom of the page slows down the top

A browser reads your page from the top and does what it is told in order. A script tag is an instruction to stop, fetch, and run — and by default it blocks what comes after it, including the text and images somebody is waiting to see.

Where the script appears in your markup is not where its cost lands. The cost lands on whatever the visitor is looking at while the browser is busy.

So a widget guarding a form nobody has reached yet is paid for by every visitor who never reaches it. On a phone, on a mobile connection, that bill is seconds.

What we changed

The script is no longer loaded when the page loads. It is injected when the form comes within 300 pixels of the viewport, or the moment somebody focuses a field — whichever happens first.

If you scroll to the form, it is already there by the time you arrive. If you never scroll, it is never fetched.

Nothing about the protection changed. The form cannot be submitted without the check; the check simply arrives when it becomes relevant rather than before anybody needs it. Score back to 100.

The general shape

Count the third-party scripts on your busiest page. Chat widgets, analytics, heat maps, booking embeds, review badges, consent banners, bot checks. Most sites have between four and a dozen and cannot name them all from memory.

For each one, two questions:

  1. Does it need to run before the page is readable? Almost nothing does. Consent banners are the honest exception, which is why they should be small.
  2. What is it protecting or measuring, and where is that on the page? Anything serving the bottom of a long page should not be loaded at the top of it.

What this is really about

Page speed gets discussed as a ranking factor, which makes it sound like a marketing concern. It is not.

It is the gap between somebody tapping your link and seeing something. On a phone, on a bad connection, waiting on scripts for a form six screens down, that gap is where people leave — and they do not file a ticket about it. The page works. It is just slower than their patience, and the only trace is a number in analytics nobody is accountable for.

The reason to measure rather than argue is that the answer is frequently one script, and it is frequently not the one anybody suspected.

What a full audit covers is published, and if you would rather just know what your own page is loading, tell us the address and we will look. The reply is free.

Recognise any of this in your own system? Describe what breaks and a person replies within one business day. Free, and a person is what’s at the other end.

Write to us  ·  The work  ·  What things cost  ·  All writing