Monitor your first website free, no card needed. Explore SENRIKO

Website loading speed: how to check it and what to fix first

A shop’s category page takes eight seconds to open while the homepage is quick. On another site the HTML arrives at once, yet the visitor stares at a white screen for several seconds. Slow loading is noticeable in both cases, but the causes of the delay are different.

Website loading speed: where does the time go? TTFB, FCP and LCP, then a check of the actions after the changes
Contents
  1. Which metrics describe website loading speed?
  2. How do you check website speed with PageSpeed Insights?
  3. Case: a catalogue filter delayed the server’s response
  4. Case: an A/B-testing script left a white screen
  5. What should you fix first?
  6. How do you check the result and keep your forms working?
  7. Frequently asked questions about website speed

Checking a site’s speed starts with choosing a page and a measurable stage of the delay. We match the metrics against the network log and what the application is doing. In a catalogue this led us to a MySQL query, and on another page to an A/B-testing script in the head.

Which metrics describe website loading speed?

The server’s answer, the appearance of content and the reaction to an action happen at different stages. If the server is slow to answer, look at the path to the first byte; if the HTML has already arrived, find out what holds up the display. The metrics help you choose between the two.

An analytics dashboard on a laptop screen showing page load time against bounce rate
Illustration. Photo: Luke Chesser, Unsplash.
Five metrics and what each measures
MetricWhat it measuresWhat it is useful for
TTFB, Time to First ByteThe time until the first byte of the response arrivesChecking delays in connecting and in producing the response
FCP, First Contentful PaintThe time until the first content is drawnSeeing how long the visitor waits for anything to appear
LCP, Largest Contentful PaintThe time until the largest visible block of content is drawnJudging when the main image or text appears
INP, Interaction to Next PaintThe delay before the page reacts to interactionsChecking how responsive buttons and other controls are
CLS, Cumulative Layout ShiftHow much the layout moves aroundFinding unexpected jumps of the page while it is used

The Core Web Vitals are LCP, INP and CLS. web.dev’s targets for good field values are an LCP within 2.5 seconds, an INP of 200 milliseconds or less and a CLS of 0.1 or less, each judged at the 75th percentile of page loads, the value that three quarters of visits meet. TTFB and FCP stay useful for diagnosis, but they belong to a different set of metrics.

TTFB is made up of network and server stages: redirects, the DNS lookup, connecting and negotiating TLS, and the request up to the first byte. web.dev calls 0.8 seconds or less good and anything over 1.8 seconds poor. A high TTFB can come from the connection, from redirects or from how the request is handled, and it does not automatically mean you need a bigger server. First find out which stretch of the wait takes the time.

The sequence from navigation to the first byte, the first content and the largest content; TTFB, FCP and LCP measure different moments.

How do you check website speed with PageSpeed Insights?

Start with an important slow URL and PageSpeed Insights in its mobile mode. Read the real-user data and the Lighthouse lab run separately: they answer different questions.

  1. Pick several pages by their role

    An ad landing page, a category with filters, a product page, the checkout or a booking page. Measuring only the homepage can miss a delay that appears after the visitor moves into the catalogue.

  2. Run the page

    Open PageSpeed Insights and test the chosen address. Save the result, the date and the device mode, then compare the mobile and desktop results.

  3. See whether there is real-user data

    Look for field data for this URL. If there is not enough of it, the report may show data for the whole origin (the site with the same scheme, host and port), or have no field block at all.

  4. Read the lab part

    In the lab part, find the slow stages: the server response, the discovery of the main resource, blocking resources or long JavaScript work. Treat the overall score as a guide for a first look; for a fix you need specific observations.

  5. Keep the conditions

    For a before-and-after comparison, save the measurement conditions and take several runs in the same mode. For local diagnosis, keep the network, cache and device settings the same.

According to the PageSpeed Insights documentation, field data comes from the Chrome User Experience Report (CrUX) and covers the previous 28 days, while the lab test, which uses Lighthouse, shows a single load in a simulated environment. So after a fix the lab result can change at once, while the field figure still includes the old slow visits.

For a problem that appears after a filter, a click or another action, repeat that path in DevTools. The Network panel shows the requests and the wait for each response; Performance helps break down what the browser is doing. Keep the request or the part of the recording that shows the delay together with the automatic report.

A laptop showing a profiler with a list of types, memory use and a graph
Illustration. Photo: Daniil Komov, Unsplash.

Case: a catalogue filter delayed the server’s response

When the HTML arrives late, start with the wait for the response and the work done on the server.

CaseAnonymous caseAuto parts catalogue

Filtered pages took up to eight seconds

What we saw
In an auto parts catalogue, pages with filters took 5 to 8 seconds to open. Almost all of the wait was TTFB, while pages without filters were fast.
What we found
We turned on MySQL’s slow query log with a threshold of one second. It caught a catalogue query, shown below. It ran for about six seconds and processed about three million rows. The plan included a separate filesort. There were indexes on category_id and brand_id, but only separately, and they did not serve this lookup together with the sort by price.
What was done
For this query we added a composite index on (category_id, brand_id, price). In this project the query time fell to 15 ms and the page’s TTFB to 200 ms.
  • 6 sfor the query, about 3 million rows
  • 15 msfor the query after the composite index
  • 200 msTTFB of the page after the fix
The query from the slow query log
SELECT * FROM parts
WHERE category_id = 15 AND brand_id = 4
ORDER BY price DESC
LIMIT 20;

The point of the fix is to match the index to this condition and this order. MySQL’s manual on multiple-column indexes explains how the leading columns of a composite index are used, and its page on ORDER BY optimisation says that Using filesort in the Extra column of EXPLAIN means an index was not used for the sort. Before adding an index, look at the query plan and the real execution: a different combination of filters may need a different solution.

MySQL (the index name is an example)
EXPLAIN SELECT * FROM parts
WHERE category_id = 15 AND brand_id = 4
ORDER BY price DESC
LIMIT 20;

ALTER TABLE parts ADD INDEX category_brand_price (category_id, brand_id, price);

The delay came before any HTML existed, so we began with how the database ran the query. After the change we measured both the query and the page’s response: those measurements tied the technical fix to the visitor’s wait. Work on images could be judged at the next stage of loading.

Case: an A/B-testing script left a white screen

A fast server response still has to be parsed by the browser.

CaseAnonymous caseSite with a third-party A/B service

A white screen despite a fast server

What we saw
On another site the HTML arrived quickly, but the main content appeared after a long delay. In PageSpeed’s mobile lab test, LCP reached 12 seconds.
What we found
The Network panel, with network throttling on, showed a third-party A/B-testing script in the head. It was an ordinary external script, with neither async nor defer. Its file, about 50 KB, took more than four seconds to load, and HTML parsing waited for it to download and run.
What was done
We set the integration to load asynchronously and to show the content by default until the tests initialised. The other non-critical scripts got defer. After the fix, in the mobile lab measurement, FCP was 1.5 seconds and LCP fell to 2.5 seconds. Those are two different results: the first content and the main content appearing.
  • 12 sLCP in the mobile lab test before the fix
  • 2.5 sLCP after the fix
  • 1.5 sFCP after the fix

An ordinary external script with neither attribute is fetched and run before the browser carries on parsing the page, so loading it and running it hold up everything after it. async fetches the file in parallel and runs it as soon as it is ready, with no guarantee of order between independent files, and running it can still occupy the main thread.

defer fits when a script needs the parsed document, or a fixed order among deferred scripts. It also allows parallel downloading, and the scripts run in document order once parsing is done. So putting async on a whole set of files is risky: one script can run before the one it depends on.

With an A/B integration, both the loading method and what the page shows before the experiment is ready matter. Check whether the content stays available while the third-party service is answering. In our project the regular version of the page showed until the test initialised, and we confirmed the result with separate FCP and LCP measurements.

What should you fix first?

Choose the fix by the stage that takes longest and by how much the page matters. First remove the delay that stops the visitor getting or using the content they came for. Then measure again and move to the next noticeable constraint.

From observation to work
What you seeFirst checkPossible direction of work
The first byte arrives lateThe time to connect and the time the request takes to runDatabase queries, external dependencies, caching, infrastructure
The HTML is fast, but the main content appears lateWhen the LCP resource is discovered and loadedResource priority, the size of the main image, blocking styles
JavaScript loads or runs for a long time before the contentThe sequence in Network, and the work of the main threadHow scripts are loaded, dependencies, the amount of code that runs
The page is visible but reacts poorly to actionsInteraction delays and long tasksHandler code and the work of the main thread

Do not lazy-load the main image

Do not defer the main LCP image with loading="lazy": the browser may discover it later, and the main content will appear later with it. For images below the first screen, lazy loading can be the right choice. web.dev’s guidance on LCP ties the choice to when a specific resource is discovered and how it is prioritised, and suggests fetchpriority="high" on the image likely to be the LCP element, for one or two images at most.

The same guidance splits LCP into four parts: TTFB, resource load delay, resource load duration and element render delay. On a well-optimised page TTFB and the load duration take about 40% of the time each, and the two delays stay under 10% each, which is a quick way to see which part is out of proportion.

For a slow query, start with its plan and how it runs. For late display of HTML that has already arrived, work out the browser’s path to the content. Then choose work on images, JavaScript or caching by the delay that is left, and measure again after each change.

How do you check the result and keep your forms working?

Repeat the measurements in comparable conditions and check the action that matters to the user. Fast loading does not confirm that sending the form and the analytics event still work after scripts have been moved.

For the control comparison, write down the URL, the device mode, the network conditions, the metrics you chose and the changes. Compare several lab runs. Look at field data separately, bearing in mind the 28-day window and which URL or origin the report shows.

Then walk the customer’s path: open the page, use the filter, fill in the form or finish the checkout step that matters. Check the result on the server and that the expected event appears. For a payment, compare the order status with the payment system, rather than stopping at the thank-you page loading.

After you change tags, use the free GA4 checker from SENRIKO: it shows the visible IDs and the events sent during a browser visit. It does not submit a form.

To check a form regularly, along with the signal it should produce, add the site to SENRIKO’s monitoring once its ownership is verified.

Keep two results of the control check: the loading measurements and a pass of the action that matters. In our filter case the reference values were the MySQL query time and the TTFB; when scripts are moved, the form and the expected event are added to the measurement.

Frequently asked questions about website speed

What is a good website loading speed?
There is no single number for every page. Google’s web.dev gives targets for the 75th percentile of real page loads: an LCP within 2.5 seconds, an INP of 200 milliseconds or less and a CLS of 0.1 or less. For the time to the first byte, 0.8 seconds or less counts as good. Judge your own pages against these, starting with the ones that matter most.
Does page speed affect SEO?
Google says its ranking systems use Core Web Vitals, and also that good scores do not guarantee a top position, because there is more to a good page experience than those scores. Treat speed as part of a good experience for visitors rather than as a ranking trick.
Why does my PageSpeed score differ from what real visitors get?
The lab test shows one load of the page in a simulated environment. Field data comes from real Chrome users over the previous 28 days. They answer different questions, so compare like with like, and expect the field figure to lag behind a fix.
Is TTFB a Core Web Vital?
No. The Core Web Vitals are LCP, INP and CLS. TTFB is still a useful diagnostic: it shows whether the wait comes before the HTML arrives, and so whether to look at the server or at the browser.

Sources

  1. About PageSpeed InsightsGoogle for Developers
  2. Web Vitalsweb.dev
  3. Time to First Byte (TTFB)web.dev
  4. Optimize Largest Contentful Paintweb.dev
  5. <script>: the script elementMDN Web Docs
  6. Multiple-Column IndexesMySQL 8.4 Reference Manual
  7. ORDER BY OptimizationMySQL 8.4 Reference Manual
  8. Understanding Google Page ExperienceGoogle Search Central

Who writes this

SENRIKO team

We build the checks SENRIKO runs on websites and write about the breakages they catch.

How SENRIKO works

Hear about a breakage before your customers do

SENRIKO checks the forms, tags and cookie consent on your site and writes when something stops working. The first site is free.

Start free