Tutorial

How websites actually get faster

Most slow websites are slow because of images. If you fix only one thing this week, fix your images: modern formats, the right sizes, and lazy loading below the fold. Everything below is ordered by impact, so start at the top.

Measure first, guess never

Before changing anything, find out what is actually slow. Run your URL through PageSpeed Insights. It shows two kinds of data, and the difference matters:

  • Lab data, from Lighthouse: a controlled test on a fast connection. Good for diagnosing specific problems.
  • Field data, from the Chrome UX Report: measurements from your real visitors. This is what Google uses when ranking is on the line.

If the field data says your visitors are fine but the lab test complains, trust the field data. Fix what real users feel.

The numbers you are aiming for

Google's Core Web Vitals thresholds, unchanged through 2026, measured at the 75th percentile of real visits:

MetricWhat it measuresGoodNeeds workPoor
LCPHow fast the main content appears≤ 2.5s2.5to 4s> 4s
INPHow fast the page responds to taps and clicks≤ 200ms200to 500ms> 500ms
CLSHow much the layout jumps while loading≤ 0.10.1to 0.25> 0.25

Source: Google Search Central thresholds, confirmed by 2026 reporting. INP replaced the older FID metric in March 2024.

Fix 1: Images, the biggest win for the least effort

Images are usually the heaviest thing on a page, and the fixes are mechanical:

  1. Serve AVIF or WebP. About 95% of browsers decode AVIF and about 97% decode WebP (caniuse figures, September 2026). Use the <picture> element so the browser picks the best format it understands, with JPEG as the fallback:
    <picture>
      <source srcset="photo.avif" type="image/avif">
      <source srcset="photo.webp" type="image/webp">
      <img src="photo.jpg" alt="Describe the photo" width="1200" height="800">
    </picture>
  2. Serve the right size. A 2400px image displayed at 400px wide wastes bandwidth on every visit. Use srcset to offer multiple sizes and let the browser choose.
  3. Lazy-load below the fold. Add loading="lazy" to images visitors have to scroll to. The top of the page loads first; the rest waits its turn.
  4. Always set width and height. Without dimensions, the browser cannot reserve space, the layout jumps when the image arrives, and your CLS score pays for it.

Fix 2: JavaScript, the INP killer

INP measures responsiveness across the whole visit, and heavy JavaScript is the usual suspect. Three practical moves:

  • Load less of it. Audit third-party scripts: chat widgets, trackers, social embeds. Each one costs load time and main-thread time. Remove what you cannot justify.
  • Defer the non-critical. Scripts that are not needed for the first paint should not block it. defer and async exist for exactly this.
  • Break up long tasks. If one script hogs the main thread, the page cannot respond to taps until it finishes. Split the work so the browser can breathe between chunks.

Fix 3: Fonts

Custom fonts block text rendering when loaded badly:

  • Use font-display: swap so text appears immediately in a fallback font, then swaps when your font arrives.
  • Load only the weights and character subsets you actually use. Four weights of a full Latin-and-extended set is a common, invisible tax.

Fix 4: Caching and compression

  • Browser caching for static assets, so repeat visits barely download anything.
  • Compression (Brotli or gzip) for text assets: HTML, CSS, and JavaScript.
  • A CDN if your visitors are far from your server.

What not to chase

A perfect lab score. Lighthouse grades one controlled run; your visitors use mid-range phones on shaky connections. Aim for green field data in PageSpeed Insights instead. A site with a 95 lab score and red field data is slower for real people than the reverse.

Read the report like a developer

PageSpeed Insights tells you which metric is red. That alone narrows the search enormously. Here is where to look first for each one:

Red metricMost likely culpritFix first
LCPHero image too heavy, or a slow server responseCompress and convert the hero image; preload it if it is critical
INPToo much JavaScript running on interactionAudit third-party scripts; break up long tasks on the main thread
CLSImages, embeds, or ads with no reserved spaceSet width and height on media; reserve space for late-loading blocks
Lab green, field redReal users on slower phones and networksTest on a mid-range device; stop optimizing for the lab score

Two red metrics usually share one root cause. Fix the biggest one first and re-measure before touching anything else; otherwise you will never know what actually worked.

Frequently asked questions

Should I convert all my images to AVIF by hand?

No. Set up your build process or CMS to generate AVIF and WebP automatically, with a JPEG fallback through <picture>. The small share of browsers that cannot decode AVIF get WebP or JPEG without you thinking about it again.

Will a faster site rank higher on Google?

It helps, but treat it as a tiebreaker, not a trump card. Google has consistently described page experience as the deciding factor between pages that are otherwise similar on relevance. Fix the speed, then keep publishing content worth ranking.

Do I need a developer for any of this?

Image fixes (formats, sizes, lazy loading) are often doable through a plugin or a CMS that handles them. JavaScript surgery and server configuration usually need a developer. If that is where you are stuck, that is literally what we do.

Last verified: October 24, 2026, against Google's Core Web Vitals documentation and caniuse data. Re-verify thresholds against Google Search Central if reading this much later; the numbers above were current at publication.

Site still slow after all this?

Some performance problems live in the server config or the codebase. We diagnose those for clients every week.

Ask us to look →

← All tutorials