Skip to content

A practical guide to faster websites

How to measure a slow website on a phone, fix the usual causes (images, JavaScript, third-party scripts and fonts) and check that the changes worked.

A practical guide to faster websites
Topic
Engineering
Published
Updated
Reading time
3 min read

A slow website costs you visitors before they have read a word. Fixing it is rarely about one trick. It is about measuring properly, finding what is actually slow, and removing it. This is the process I follow.

1. Measure first, on a phone

Most visitors arrive on a phone, often on a mobile connection, so test that way. Useful tools, all free:

  • PageSpeed Insights shows lab results and, when your site has enough visitors, real-user data from Chrome.
  • Google Search Console has a Core Web Vitals report grouped by page type.
  • Chrome DevTools lets you slow the network and processor down to match a mid-range phone and see exactly what loads, in what order.

Write down the page weight, the number of files loaded, and when the main content appears. Those three numbers tell you most of what you need to know.

The difference between sites can be large. On a simulated mid-range phone on a slow 4G connection, I recently measured a 425 KB home page showing its main content in about 3.4 seconds, and a page of over 5 MB taking more than 20 seconds. Page weight was the main reason for the gap.

2. Fix images first

Images are usually the heaviest part of a page.

  • Serve WebP or AVIF instead of large PNG or JPEG files.
  • Resize images to the size they are shown at, and offer smaller versions for phones with srcset.
  • Add width and height so the layout does not jump while images load.
  • Lazy-load images further down the page, but never the main image at the top.

3. Send less JavaScript

Every script has to be downloaded, read and run, and on a phone that takes real time. Remove libraries you no longer use, load scripts with defer, and only load heavy parts, such as a map or a chat widget, when someone needs them. If clicks and taps feel slow, that is usually JavaScript too. I cover that in Interaction to Next Paint.

4. Be strict with third-party scripts

Analytics, chat, video embeds and tracking pixels often add more weight than the site itself. List every one, ask whether it is still used, and remove the rest. For analytics, a small, cookie-free tool is often enough. See website analytics for a small business.

5. Load fonts carefully

Use one or two font families, only the weights you need, in WOFF2 format, with font-display: swap so text appears straight away.

6. Cache and compress

Turn on compression on the server, give static files long cache times with versioned file names, and consider a CDN if your visitors are spread across countries.

7. Check that it worked

Run the same tests again under the same conditions and compare. Lab tools give you quick feedback; real-user data in Search Console takes about four weeks to update, so check back then.

Why it matters for search

Google uses Core Web Vitals as one of many ranking signals. Speed will not make thin content rank, but a slow site makes good content harder to use. The rest of the technical checklist is in technical SEO foundations for a website launch, and phone layouts are covered in designing a website that works on smaller screens.

Written by Lay Shah, an independent developer building websites and tools for small businesses. Discuss a brief More articles

Next article Choosing a framework for your web application