Skip to content
ع
Web Development

Website Speed Optimisation: What Slows Your Pages and the Order to Fix It In

Website speed guide: what slows pages down, how LCP, INP and CLS measure website speed, and the right order to fix hosting, images, and scripts.

Ahmad Khreiswebmaster5.0(2)
Published 12 min read
Illustration for the article: Improving Website Speed: A Practical Guide for Non-Technical Owners

Website speed isn't a technical luxury; it's part of a visitor's first experience. A slow page gets closed before its headline is read, especially on mobile. The good news is that the causes of slowness are well known and can be fixed in a clear order, starting with the foundation before the details. This guide orders the causes, shows what Google's data says about their impact, and explains how website speed is actually measured in plain language for beginners.

Key takeaways

  1. 1Every extra second raises the chance a mobile visitor leaves.
  2. 2Fix in order: hosting and caching, then images, then scripts and fonts.
  3. 3Measure with real-visitor data, not one test on your own device.
  4. 4Third-party scripts are the most forgotten and the biggest slowdown.
  5. 5"Speed" is three things: content appearing, responding to taps, and staying visually stable.
  6. 6A mid-range phone executes scripts several times slower than your laptop; the CPU is part of the problem, not just the network.

Why does website speed matter?

Visitors don't wait. Google and SOASTA's study of mobile pages shows how the probability of leaving rises with every extra second of load time:

How much does a mobile visitor's chance of leaving rise as load time grows?

  • From 1s to 3s+32%
  • From 1s to 5s+90%
  • From 1s to 6s+106%
  • From 1s to 10s+123%
The increase compared with a page that loads in one second.Source: Google/SOASTA mobile page speed research, 2017

To read these numbers correctly: the relationship is a statistical correlation, not proven causation, and the data was published in 2017 about mobile pages. It doesn't mean every second costs you 32% of your customers; it means the direction is consistent — waiting drives visitors away. The size of the effect varies with intent: someone waiting for a payment result is far less patient than someone browsing an article.

Google measures the same experience with Core Web Vitals, explained in our Core Web Vitals guide. Improving them is part of Google's page experience signals, but they never outweigh how well your content matches the searcher's intent: a slow, useful page can outrank a fast, empty one.

What are we measuring when we say website speed?

The most common mistake is treating speed as a single number. Picture a visitor opening your page on a phone. They're asking three questions, consciously or not: "When do I see what I came for?", "Does it respond when I tap?", and "Is the text jumping around under my finger?" That's why website speed comes down to three metrics:

LCP — content appears

The largest visible element (image or heading) renders in 2.5 seconds or less.

INP — responsiveness

From the tap to the visible result: 200 milliseconds or less.

CLS — visual stability

How much elements shift while loading: 0.1 or less.

LCP stands for Largest Contentful Paint. The browser identifies the biggest image or text block in the first screen and records when it finished rendering. It's the closest number to the feeling that "the page has opened."

INP stands for Interaction to Next Paint. It measures the worst delay a visitor experienced between interacting and seeing the result on screen. It replaced the older FID metric in March 2024, because it measures responsiveness across the whole page lifetime, not just the first click.

CLS stands for Cumulative Layout Shift, a unitless score that adds up unexpected movement. The usual causes are an image without reserved dimensions, an ad injected above the content, or a web font swapping in after the text appears.

LCP thresholds (in seconds)

GoodNeeds improvementPoorTarget threshold
2.54
  • Good2.5 seconds or less
  • Needs improvementBetween 2.5 and 4 seconds
  • PoorMore than 4 seconds
Measured at the 75th percentile of real visitor page loads, with mobile and desktop reported separately.

The 75th percentile (p75) simply means this: sort every visit to your page from fastest to slowest, and the value at the 75% position is your official number. Three quarters of your visits were that fast or better. Google doesn't ask you to be fast for everyone — only for most people, in the harder conditions. This data is collected over a rolling 28-day window, which is why your fix doesn't show up immediately.

There's a fourth metric that isn't part of Core Web Vitals but is the foundation of diagnosis: TTFB, or Time to First Byte — the time between requesting the page and receiving the server's first response. A practical target is under 0.8 seconds. If you're above it, your problem is in the foundation, not in your images.

What happens in those first seconds?

When a visitor types your address and hits Enter, a short but crowded journey begins. Understanding it explains why website speed isn't one number, and why each problem has its own place to be fixed:

  1. 1
    Finding the address (DNS)

    The browser turns your domain name into a numeric server address, like the internet's phone book. Rarely slow, but it adds to every new connection.

  2. 2
    Opening a secure connection (TLS)

    Browser and server agree on encryption. Extra round trips mean extra delay, especially over long distances.

  3. 3
    Waiting for the first byte (TTFB)

    The server receives the request, runs code, queries the database, then replies. Hosting problems and heavy plugins show up here.

  4. 4
    Reading HTML and discovering resources

    The browser reads the page line by line and queues every file it finds: CSS, scripts, images, fonts.

  5. 5
    Downloading render-blocking files

    Files the browser refuses to display the page without. Every blocking file at the start postpones everything else.

  6. 6
    Painting content and reaching LCP

    The first screen finally appears. This is where the visitor decides whether they found what they came for.

  7. 7
    Executing scripts and becoming interactive

    The page turns from a picture into a working interface. Buttons, menus and forms respond once this work is done.

To understand that last step you need one term: the main thread. The browser does most of its work on a single track. If it's busy with a long task, it can't answer your visitor's tap until it finishes. A long task is any piece of work taking more than 50 milliseconds without a break.

Here's a fact many people miss: 100 KB of JavaScript is heavier than 100 KB of images. An image is downloaded and decoded. A script is downloaded, then parsed, compiled and executed on the CPU. That's why your site feels fast on your laptop and slow on a mid-range phone — even on the same network.

In what order should you fix slowness?

Fixing details before the foundation wastes effort: compressing an image is pointless if the server takes two seconds to respond. Start at the bottom:

The speed pyramid: from foundation to details

  1. Fonts and detailsPreloaded fonts with few weights, and lazy loading below the first screen
  2. Third-party scriptsAs few plugins, trackers and chat widgets as possible, loaded late
  3. Images and videoThe right size, a modern format and good compression
  4. Caching and CDNReady-made pages served instantly, files from a server near the visitor
  5. Hosting and serverA fast-responding server in a region close to your audience
Start at the bottom. Each layer depends on the one below, and no improvement at the top makes up for a slow foundation.

Foundation one: the server and first-byte time

TTFB has two parts: network time (the distance between visitor and server, plus connection round trips) and processing time (running code and querying the database). On crowded shared hosting you're splitting CPU and memory with hundreds of other sites, so your performance fluctuates with your neighbours' traffic.

Check three things in order: measure TTFB from your audience's region, not from your desk; review the queries and plugins that run on every request; and enable text compression with Brotli (or gzip) — think of it as ZIP for your HTML, CSS and JS, shrinking files without changing their content. Also confirm your site runs on HTTP/2 or HTTP/3, which let several files travel over one connection instead of waiting for each in turn.

Foundation two: caching and the CDN

A cache keeps a ready-made copy instead of rebuilding it for every visitor. It lives in four different places, and much of the confusion comes from mixing them up:

  • Browser cache: files stored on the visitor's device, so they aren't downloaded again next visit.
  • Page cache: a ready-made HTML copy on the server, served without running code or database queries.
  • Object cache: repeated database query results kept in memory.
  • CDN cache: copies on servers distributed worldwide, served from the closest location.

A cache hit means the ready copy existed; a miss means the server had to rebuild it. Every copy has a TTL (time to live) after which it's refreshed, and you must invalidate it when you publish changes so visitors don't see a stale page.

Two things beginners overlook: first-time visitors get nothing from the browser cache because they've stored nothing yet — page caching and the CDN are what speed up that first visit. And logged-in users or shopping carts usually bypass caching for security reasons, so test as a normal visitor, not while logged into your admin panel.

Images: the fastest win

Images are usually the biggest part of page weight, and improving them doesn't need a developer. Shrink dimensions to the largest size they're actually shown at with the Image Resizer, compress them with the Image Compressor, and convert them to WebP or AVIF with the Image Converter. Details are in our image optimisation guide, and for video in our video compression guide.

To understand the "why," separate two things: dimensions in pixels and weight in kilobytes. A 4,000-pixel-wide image displayed in an 800-pixel slot means you're paying five times the weight for zero visible benefit. But don't shrink it to exactly 800: high-density (Retina) screens use two pixels per point, so doubling to 1,600 pixels is enough. The elegant solution is the srcset attribute, which offers the browser several sizes so it picks the right one for each screen.

Format Best for Practical note
JPEG Photographs Widest compatibility, a safe fallback
PNG Logos and images with transparency Far too heavy for photographs
WebP A general-purpose replacement Smaller than JPEG at similar quality, widely supported
AVIF Maximum weight savings Better compression, slower to encode
SVG Icons and simple graphics Vector-based, stays sharp at any size

Practices that slow the page

  • A 4,000px image in an 800px slot
  • A photograph saved as PNG
  • Lazy loading every image, including the hero
  • Images without width and height, so content jumps
  • An autoplaying background video on mobile

Practices that speed it up

  • Double the largest displayed width, plus srcset
  • WebP or AVIF with a fallback
  • Lazy loading only below the first screen
  • Reserved dimensions or a fixed aspect ratio
  • A poster image with preload="none", or a click-to-load facade

Fonts: hidden delay and jumping text

A font is a downloaded file like an image, but it blocks something more important: your text. Until it arrives, the browser has two options — hide the text until the font loads (FOIT), or show a fallback font and swap later (FOUT). The first makes your page look empty; the second can change line widths, shifting content and hurting CLS.

Four steps solve most of it: use the compressed woff2 format; cut weights down to two (regular and bold) instead of six; enable font-display: swap so text appears immediately; and subset the font, meaning strip out characters you never use. Subsetting matters especially for Arabic and other non-Latin scripts, whose files carry many contextual letterforms and marks. Add preload for the single weight used above the fold, and self-host your fonts to save a connection to an external origin.

Third-party scripts: the slowness you don't see

Every plugin, tracker, chat window and share button is an extra script the browser downloads and runs. Over time they pile up without anyone noticing:

Why does a script's impact exceed its size? Because its cost comes in three stages: download, then parse and compile, then execute on the main thread. Tracking tools in particular run on every click and scroll, so they lengthen interaction time (INP) long after loading has finished.

Three practical techniques reduce that cost:

  • defer and async: they tell the browser not to pause page building while the script downloads. defer runs it after HTML parsing, in order — the right choice for most of your own scripts. async runs it as soon as it's ready, in no particular order — better for independent trackers.
  • The facade pattern: show a static placeholder for the chat widget or video player, and load the real script only when the visitor clicks. Most visitors never open the chat, so why should everyone pay for it?
  • preconnect: for third-party origins you genuinely can't avoid, open the connection early instead of waiting until the moment of need.

And measure instead of guessing: in your browser's developer tools, block a specific script request and re-test, or use the Coverage panel to see how much of the downloaded code is never actually used.

How do you measure progress?

Don't settle for one test on your fast laptop; your visitors use different devices and networks:

Before the steps, understand that measuring website speed has two distinct modes, and confusing them is the most common source of frustration:

Lab data (Lighthouse)

  • A simulated mid-range phone on a slow network
  • Instant, repeatable results in the moment
  • Excellent for diagnosis and before/after comparison
  • Doesn't include real INP; uses blocking time as a proxy
  • A score of 100 doesn't mean your visitors are happy

Field data (CrUX / RUM)

  • Real measurements from your visitors' browsers
  • Collected over 28 days at the 75th percentile
  • Mobile and desktop are assessed separately
  • Needs enough traffic to appear
  • This is what Google uses to assess experience
  1. 1
    Start with real-visitor data

    In PageSpeed Insights and the Core Web Vitals report in Search Console.

  2. 2
    Test the important pages

    The homepage, service pages and the pages that bring traffic.

  3. 3
    Fix in order

    Foundation first, then images, then scripts.

  4. 4
    Measure again after a few weeks

    Real-visitor data updates gradually.

When a metric is poor, don't fix at random. LCP breaks into four parts, each with a different remedy:

Part What it means The fix
Time to first byte The server was slow to reply Better hosting, page caching, CDN
Resource load delay The browser discovered the image late Remove lazy loading, add fetchpriority and preload
Resource load duration The file is heavy or the server is far away Dimensions, format, compression, CDN
Element render delay Fonts, CSS or scripts block painting font-display, fewer blocking files, deferred scripts

INP breaks into three: input delay (the main thread was busy when the visitor tapped), processing time (the event handler's own code), and presentation delay (recalculating layout and painting the screen). The cure in all three cases is the same in essence: shorter tasks and less script work.

CLS causes are nearly always the same short list: images and embeds without reserved dimensions, fonts swapping after paint, and elements injected above the content such as ads or consent banners.

Tool What it tells you When to use it
PageSpeed Insights Field data plus lab diagnosis together Always your starting point
Search Console Real page status grouped by template To find which templates are suffering
Lighthouse Detailed diagnosis and actionable advice During development, before and after each fix
DevTools (Performance) Long tasks and what occupied the main thread When INP is poor
WebPageTest A detailed waterfall from global locations To test the effect of distance and network
Real user monitoring (RUM) Immediate alerts when performance regresses For continuous monitoring after launch

Three habits keep your testing honest: test in a private window with no browser extensions, run the test three times and take the median rather than the best result, and test as a logged-out visitor. And don't test only the homepage — one broken article template affects hundreds of pages at once.

Also check your pages with the Website SEO Checker to see performance and SEO issues together, and read our technical SEO guide for the full picture.

Common mistakes that waste your effort

  • Chasing a 100/100 lab score instead of improving the numbers your visitors actually live with.
  • Lazy loading every image, including the hero, which raises LCP instead of lowering it.
  • Testing only on a fast laptop, ignoring the mid-range phone most of your traffic uses.
  • Stacking optimisation plugins: two caching tools fight each other and slow the site down.
  • An autoplaying background video on mobile, consuming both bandwidth and CPU.
  • A deeply nested page structure, making layout and paint expensive even when the files are light.

A performance budget: keeping slowness from coming back

A budget is a set of numeric limits you hold yourself to on every change, so you catch slowness at deploy time rather than in a customer complaint. These are reasonable guiding targets for a content or service page — adjust them to your page type:

A suggested page weight budget (kilobytes)

  • Images400 KB
  • Scripts200 KB
  • Fonts100 KB
  • HTML and CSS100 KB
Guiding targets for a content or service site, not a measurement of your site; interactive pages may need different limits.Source: Suggested performance budget as practical targets

Tie the budget to a simple routine: a quick check after every release, a monthly look at the Core Web Vitals report, and a quarterly script audit. Speed isn't a project you finish; it's a habit you maintain.

A quick glossary

Term What it means in plain words
TTFB Time to first byte: from request to the server's first reply
LCP When the largest element on the first screen appears
INP The delay between an interaction and its visible result
CLS How much elements shift unexpectedly while loading
p75 The value 75% of visits are at or better than
CrUX / RUM Performance data collected from real visitors
Cache A ready-made copy served instead of rebuilding
CDN A distributed server network serving files from the nearest location
Lazy loading Delaying offscreen content until the visitor approaches it
Render-blocking A file the browser won't display the page without
Main thread The browser's primary work track for scripts and painting
Long task Work over 50 ms that delays responsiveness
Brotli Text compression that shrinks files without changing content
srcset Offering the browser several image sizes to choose from

Conclusion

Speeding up a website follows an order: fast hosting and caching, then light images, then fewer and smarter scripts, then fonts and details. Measure with real-visitor data, review scripts regularly, and give every change a budget it must not exceed. Start today by measuring TTFB and LCP on your most-visited page, then fix the slowest part first. If you'd like a website built for speed from day one, see our website development service.

Frequently asked questions

How do I measure my website's speed?

Use PageSpeed Insights to see real-visitor data (Core Web Vitals) and improvement suggestions, and the Core Web Vitals report in Search Console to follow the whole site.

What usually slows websites down most?

Large uncompressed images, many third-party scripts such as plugins, tracking and chat widgets, and slow hosting without caching.

Does site speed affect SEO?

Yes, page experience including Core Web Vitals is part of Google's ranking signals, but the bigger effect is usually on visitor behaviour: staying and converting.

Do I need a CDN?

Very useful if your visitors are in different countries or you serve many static files, because it delivers files from a server close to the visitor.

Sources & references

  1. web.dev — Web Vitals
  2. PageSpeed Insights
Ahmad Khreis

About the author

webmaster

I believe technology is useful when it solves a clear problem — not when it's adopted because it's trendy. AI is a powerful tool for speeding up research, writing, analysis and automation, but it needs human expertise to review, guide and verify accuracy. That's why I prefer to start by understanding the business and its goals, then choose the simplest solution that delivers a measurable result, and build audience trust with honest, useful content.

Reader rating
5.0(2)
Published articles
82
  • #website speed
  • #performance
  • #Core Web Vitals
  • #page speed
Share

How would you rate this article?

Be the first to rate

Comments

No comments yet. Share your thoughts!

Leave a comment

Related articles