Website and web app speed: how to measure it, what slows it down and how to speed it up
The speed of a website or web app has two halves: how quickly the server prepares a response and how quickly the browser shows the page and reacts to actions. The usual culprits are heavy images, unnecessary scripts and third-party widgets, slow database queries and a lack of caching. Speeding up starts not with a rewrite but with measurement: find the slowest spot, fix it and check the result on real devices. So that speed does not degrade over time, it is checked with every release and monitored after launch.
Open the software development page
Why speed matters
A slow page loses people before they have even seen the product: some visitors do not wait for it to load, and others leave after the first delay when they tap a button. For an online store this means abandoned carts, for a service unfinished forms, and for a customer portal irritated clients and support calls.
Speed also affects search: search engines take into account how usable pages are, including loading speed and responsiveness on mobile devices. So optimisation is not cosmetic but part of product quality, just like the absence of bugs. Promotion at launch is covered in the guide to SEO and ads for a product launch.
How to measure speed
Before speeding things up, you need to know what exactly is slow and for whom. There are two kinds of measurement: lab data, where a tool checks the page under controlled conditions, and field data from real visitors on their own devices and networks. Lab data is handy for finding causes; field data shows how things really are.
| Metric | What it shows | What usually affects it |
|---|---|---|
| Time to first byte (TTFB) | How quickly the server starts sending the page | Slow code, database queries, no caching, a distant server |
| Largest contentful paint (LCP) | When the user sees the main block of the page | Heavy images, render-blocking styles and scripts, fonts |
| Interaction to next paint (INP) | How quickly the page reacts to taps and input | Heavy scripts and long computations in the browser |
| Cumulative layout shift (CLS) | Whether content jumps around while loading | Images without dimensions, late-inserted banners and widgets |
Measure on the devices and networks your audience actually uses: an inexpensive phone on mobile data behaves very differently from a developer's laptop in the office.
What slows a page down in the browser
Most of the delays users see happen on the browser side:
- images and video at original size and in outdated formats instead of scaled copies for the screen;
- many scripts loaded and executed before the page is shown;
- third-party widgets such as chats, counters, embedded maps and videos, each with its own requests;
- fonts that keep text from appearing or make it jump;
- one large code bundle for the whole application when a given page needs only a small part of it;
- images and blocks without set dimensions, which makes the layout shift during loading.
Often the most visible results come from simple steps: compress and resize images, defer loading of what is below the first screen, remove unused scripts and include third-party widgets only where they are truly needed.
What slows the server down
If the page waits a long time for the first response, the problem is on the server. Typical causes:
- slow database queries: no indexes, fetching unneeded data, many small queries instead of one;
- heavy operations right inside the user's request: sending emails, building reports, exchanging data with external systems;
- no caching for data that rarely changes but is requested constantly;
- a server far from the main audience or short of resources;
- slow external services whose responses the server waits for synchronously.
Logs and monitoring help here: they show which requests are slowest and where the server spends most of its time. How the server side works is covered in the guide to app backend development, and working with data in the guide to the web app database.
How to speed things up: the order of work
- Measure the current state on real devices and pick the pages that matter most to the business.
- Find the main bottleneck: the server, images, scripts or third-party widgets.
- Fix it with the smallest possible change and measure again.
- Repeat for the next bottleneck until the result is acceptable.
- Lock it in: add a speed check to the release process and monitor real users.
It is important to work from measurements rather than guesses. Rewriting an application in a new framework for the sake of speed rarely makes sense: usually the problem lies in a few specific places that can be fixed one by one.
Caching and content delivery networks
Caching is one of the most effective ways to speed up a service. It is used at several levels:
- in the browser, so images, styles and scripts are not downloaded again on every visit;
- in a content delivery network (CDN), so static files are served from the node nearest the user;
- on the server, so results of heavy queries and frequently requested reference data are not recalculated;
- in the database, through proper indexes that find records without scanning the whole table.
Caching has a downside: stale data. So you decide in advance what can be cached and for how long, and what must always be fresh, such as prices, stock levels and payment statuses. Code and style files get a version in their name or address so that users receive the new version right after a release.
Mobile devices and slow networks
Most visitors arrive on phones, and far from all of them have flagship models and fast internet. On an inexpensive device the same script runs noticeably longer, and on a mobile network every extra request adds delay.
- test the site on an inexpensive phone and with network throttling;
- serve images sized for the screen rather than one large image for every case;
- show the main content immediately and load secondary content as the user scrolls;
- make sure the interface responds to a tap at once, even if data is still loading.
If the application has to work where the connection is weak, consider storing part of the data on the device and working offline; these options are covered in the guide what is a web application.
How not to lose speed after launch
Speed rarely breaks because of one decision; it slips away gradually: a new widget, another counter, large images from a content manager, a slow query in a new report. To prevent this, a few simple rules are needed:
- limits on page weight and the number of scripts, checked with every release;
- an automatic speed check of key pages before deployment;
- monitoring of real-user metrics and server response time;
- automatic image compression on upload through the admin panel;
- approval of every new third-party script by whoever is responsible for the product.
How JEEKSSHIRE 24 works on speed
We build speed into the architecture from the first release: light pages, images sized for the screen, long operations in the background, money and permissions calculated on the server and a ready result sent to the client. The build, linting and tests pass before deployment, and failure alerts run after launch.
If a site or application is already slow, we start with measurements and reading the code, then propose a plan of targeted fixes. More on the pages for web application development and software support, and all our services are collected on the software development page.
Frequently asked questions
Why does a site load slowly on a phone?
Most often because of heavy images, many scripts and third-party widgets. On an inexpensive phone and a mobile network these delays are more noticeable than on a computer.
Does site speed affect search rankings?
Yes, search engines consider page usability, including loading speed and responsiveness. But the content and usefulness of a page still matter more.
What is a CDN?
It is a network of servers in different regions that serves images, styles and scripts from the node nearest the user, taking load off the main server.
Do we need to rewrite the site to make it faster?
Usually not. Speed is most often limited by a few specific things: images, scripts, slow queries or a lack of caching. They are fixed one at a time.
How can I check my site's speed?
Test key pages with a speed measurement tool and also open them on an inexpensive phone over mobile data. For the full picture you need data from real visitors.
Why does a web app slow down as users grow?
Usually because of slow database queries, heavy operations inside user requests and a lack of caching. First the bottleneck is found in the logs, then it is fixed.
Can a site be sped up without access to the code?
Partly: compress images, remove extra widgets and add a CDN. But serious causes are usually in the code and on the server, and fixing them requires access.
What is lazy loading of images?
It is a technique where images below the first screen are not loaded immediately but when the user scrolls to them. The page opens faster and no data is wasted.