← Blog

What makes a website fast: 7 technical decisions

Speed is not something a plugin fixes at the end. It starts with how the page is generated and continues through image delivery, JavaScript and post-launch measurement.

Screen showing website code and performance testing tools

A fast website does not come from one setting or a plugin added shortly before launch. Performance depends on how the HTML is produced, when the browser discovers the main image, how much data is transferred and how much work the visitor’s device must complete.

Short answer: A website is fast when it delivers useful HTML early, loads only the resources needed by the current page, serves images suited to each screen and is evaluated with real-user data — not only a single Lighthouse test.

1. Architecture determines how much work happens before content appears

On a company website, portfolio or blog, most content changes only when something new is published. In these cases, generating ready-to-serve HTML at build time can reduce the work required in the browser and on the server for every visit.

This does not mean every website should be entirely static. An online store, dashboard or application with personalised data has different requirements. A practical architecture keeps stable content static and uses dynamic rendering where real-time work provides an actual function.

The architecture also affects:

  • server response time,
  • how early the main content becomes available,
  • whether the page remains usable before JavaScript runs,
  • how effectively the response can be cached.

2. The browser should discover the main image early

Largest Contentful Paint (LCP) measures when the largest visible element in the initial viewport is rendered. This is often a hero image or a large heading. Google uses 2.5 seconds or less at the 75th percentile of page visits as the reference threshold for a good LCP.

If a hero image is inserted later by JavaScript, hidden behind a CSS reference or mistakenly marked for lazy loading, the browser discovers it late. The file may be small, but its request still starts after an avoidable delay.

A likely LCP image usually needs:

  • a real <img> in the initial HTML,
  • accurate src, srcset and sizes values,
  • width and height to reserve layout space,
  • fetchpriority="high" only when it really is the most important image in the first viewport,
  • no loading="lazy" attribute.

Giving every image high priority is not useful. If everything is urgent, the browser has no meaningful priority signal.

3. Images should match the space in which they appear

A 1,600-pixel-wide image does not need to be downloaded unchanged for a 320-pixel card. Responsive candidates let the browser select a resource that better fits the viewport and display density.

Good image delivery covers:

  • different widths for mobile, tablet and desktop,
  • modern formats such as AVIF or WebP when the production workflow supports them,
  • an honest sizes attribute that describes the real layout,
  • intrinsic dimensions that reduce layout movement,
  • lazy loading for images farther down the page.

Compression alone is not enough. A smaller file still arrives late if the browser cannot discover it until other resources have executed.

4. JavaScript should earn its place on the page

Every script must be transferred, parsed and executed. The difference may look minor on a powerful computer, while the same bundle can delay rendering and interaction on an older phone.

A content-driven website usually needs JavaScript for specific jobs: mobile navigation, forms, consent, filters or deliberate interactions. It does not necessarily need to send a complete client-side application just to display text and images.

Before adding a dependency, it is worth asking:

  1. Can HTML or CSS provide the behaviour?
  2. Does it need to load on every route?
  3. Can it be dynamically imported only when the feature applies?
  4. What happens on touch devices or when reduced motion is enabled?
  5. Is there cleanup when a component closes or the route changes?

Website performance optimisation starts by examining the real loading path, rather than removing scripts at random.

5. Fonts and CSS can delay the first useful render

Fonts contribute to a website’s identity, but every additional family and weight creates another resource. If body text waits for a large font file, the visitor may see an empty area or a visible font swap after the first render.

A practical setup uses:

  • a limited number of font weights,
  • language-appropriate subsets where the content permits them,
  • a tested font-display strategy,
  • preload only for the font needed immediately,
  • restrained critical CSS without repeated large blocks.

CSS needs maintenance on real pages too. A shared stylesheet may be useful for caching, but it should not grow indefinitely with rules for components that no longer exist.

6. Caching works when asset URLs are safe to store for a long time

Versioned assets — files with a content hash or version in their filename — can be cached for a long period because a change produces a new URL. A file that is overwritten under the same name should not receive an arbitrary immutable policy, because browsers may continue to use an outdated copy.

Performance also depends on:

  • the distance to the server or CDN,
  • unnecessary redirects,
  • compression and caching headers,
  • third-party scripts,
  • API requests that block the main rendering path.

Caching reduces repeated transfers. It does not fix a heavy first visit or a script that blocks the main thread.

7. Measurement needs both lab tests and real-user data

Lighthouse is useful for diagnosing issues in a controlled environment. It does not describe every visitor’s experience on its own. Core Web Vitals are field metrics, so the picture becomes more useful when it combines:

  • PageSpeed Insights and Chrome DevTools for diagnosis,
  • Chrome UX Report data when the site has enough traffic,
  • Search Console for grouped Core Web Vitals issues,
  • real-user monitoring for important templates and journeys,
  • repeatable tests before and after each change.

The score is a signal, not the final goal. The useful questions are which element is slow, why it is slow and whether the change improves the experience without removing necessary functionality.

A practical pre-launch checklist

  • Main content exists in the initial HTML.
  • The LCP image is discoverable in the markup and is not lazy-loaded.
  • Images have intrinsic dimensions, responsive candidates and accurate sizes.
  • Scripts load only on the routes and devices where they are needed.
  • Font families and weights are limited to the ones in use.
  • Versioned assets have an appropriate cache policy.
  • There are no unnecessary redirects or network errors.
  • The website has been tested on mobile, desktop and a slower connection.
  • Results are compared with a previous measurement, not only an absolute score.

Performance is a property of the whole system. When it is considered from architecture through deployment, each fix can address the point where the delay begins instead of covering it with a superficial adjustment.

Sources and further reading

Does your website need a technical performance review?

See what website performance optimisation covers, or send the URL for an initial discussion based on the page's actual bottlenecks.

Website performance optimisation Send your website