September 9, 2026 · Uncategorized

Third-party scripts: the part of your page you do not control

The same page measured with and without the cache

You can serve your pages from a cache, shrink every image, inline your critical CSS — and still have a slow site. Analytics, a chat widget, a consent banner, an embedded map, a font hosted elsewhere: each one is a request to a server you do not own, running code you did not write, at a moment you did not choose.

Why they cost more than their size

A 40 KB script sounds harmless. What it costs is rarely the download.

Three ways to make them cheap

Defer. The script still loads on every visit, but after the page has been built rather than before. Suitable for anything that does not draw something the visitor sees immediately.

Delay until interaction. Nothing loads until the visitor moves, scrolls or touches the screen. Ideal for chat widgets and analytics: a visitor who leaves after two seconds never triggers them at all — and they were not going to be measured usefully anyway. The effect on the metrics that matter is usually the largest single gain on a content site.

Replace with a placeholder. An embedded video loads several hundred kilobytes before anyone clicks play. Showing the thumbnail and loading the player on click removes the cost entirely for the majority who never press play.

What not to delay

Consent banners, if the law requires them before anything else runs. Payment scripts on a checkout page. Anything that draws part of the first screen. Delaying those trades speed for a broken page or a legal problem, which is not a trade.

Fonts deserve their own paragraph

A font loaded from another domain adds a connection, and often hides your text until it arrives. Two habits fix it: host the font files on your own server, and tell the browser to show the fallback immediately and swap when the real font is ready. Visitors see text at once instead of an empty block.

The audit worth doing once a year

Open the network panel, filter by domain, and list every third party your home page contacts. Then ask, for each one: what do we do with this data, and who looks at it?

On most sites the honest answer for at least half of them is “nobody, since 2022”. Removing a tag is faster than any optimisation of it, costs nothing, and reduces what you have to declare in your privacy policy — much like removing a plugin you stopped using, which is the other half of the same habit.

Celeris defers scripts, delays the ones you choose until the first interaction, and replaces embedded videos with a thumbnail — with an exclusion list for the ones that must run straight away.