A slow website usually has a few specific causes: heavy images, fonts, too much JavaScript. I show how to find them and what to do about them.
Measure first
Before you change anything, check what is slow. Enter your page address into PageSpeed Insights. Google rates speed with three metrics, the Core Web Vitals:
| Metric | What it measures | Good result |
|---|---|---|
| LCP | when the largest element on the first screen appears | up to 2.5 s |
| INP | how quickly the page responds to a click | up to 200 ms |
| CLS | how much the layout jumps while loading | up to 0.1 |
The report will point to the element that hurts the most. Below are the six causes I run into most often.
1. Heavy images
A photo straight from a camera or a stock library often weighs more than the rest of the page combined. The browser has to download it before it can show it.
What to do: save the image in a modern format (WebP or AVIF), at the size it is displayed, and add its dimensions. Load images below the first screen lazily.
<img src="/photo-800.webp" width="800" height="533" loading="lazy" alt="Photo description">
Dimensions in the attributes make the browser reserve the space before the image arrives, so the layout does not jump.
2. Fonts
Every typeface and every weight is a separate file. A page with three typefaces in four weights downloads twelve files before the text looks the way it should.
What to do: limit the weights to the ones you actually use, host the fonts on your own server and trim them to the characters that appear on the page. Preload only the fonts that are on the first screen.
3. Too much JavaScript
One library for a carousel, another for animation, a third for a form. Each of them has to download and run, and a phone does that more slowly than the computer the page was built on.
What to do: check what actually loads on the page and remove what you do not need. Some effects can be done with CSS alone, without a single line of script.
4. Content appears only after JavaScript
If the site is an app that builds its content in the browser, the user sees an empty screen until the script downloads and runs. Such a page is slow for people and hard for search engines to see.
What to do: generate HTML on the server or at build time. This website is built exactly that way: ready-made HTML for every page. Watch out for entrance animations too: a first-screen element that starts invisible and waits for a script delays LCP even if the HTML is ready.
5. Third-party scripts
A chat widget, a map, an ad pixel, an embedded video. Each of them is code from someone else's server that you do not control, and it competes with your page for time.
What to do: make a list of everything that loads from outside and, for each item, ask whether it is needed on every page. A video and a map can be loaded only after a click.
6. Server and cache
The fastest code will not help if the server thinks for a long time over every response or sends the same files again each time.
What to do: enable compression and a long browser cache lifetime for files that do not change (images, fonts, scripts with a unique name). Serve static pages as ready-made files, without assembling them on every visit.
What next
Fix one cause, measure again and only then move on to the next. That way you know what actually helped. If you would rather have speed built in from the first line than bolted on afterwards, see my websites service.
