A product listing page opens in one second on a desktop computer, but takes five seconds on a customer's mid-range phone over a mobile connection. Improving website speed means measuring every byte, request and script that reaches the browser and tying them to a budget. It is not guesswork or a single magic setting; it is an ordered piece of work.
This guide covers the page loading speed visitors actually see, in other words the front end. We covered server load in our performance testing guide and server-side caching in our caching article, so we do not repeat them here. Example figures are representative; they are not measurements of any specific site or tool.
What Stages Does a Page Load Go Through?
A page does not open as one piece; it opens through consecutive stages, and each stage has its own reason for waiting. You need to know the chain before you hunt for slowness.
| Stage | What happens | Typical cause of slowness |
|---|---|---|
| Connection | The domain is resolved and a secure connection is set up | The server is far from the visitor |
| First byte | The server sends the first response | Slow page generation, uncached response |
| First meaningful paint | The first content appears on screen | Render-blocking CSS and scripts |
| Largest content | The main image or heading block becomes visible | A heavy image, or one discovered late |
| Interaction | The page responds to a tap | JavaScript filling the main thread |
Count connection setup in the first stage. If the round-trip time is 100 ms, the domain lookup, connection, secure handshake and request cost about 4 × 100 = 400 ms (a simplified count); if the server produces its response in 300 ms, the first byte arrives at 700 ms. If the server is close to the visitor, the round trip drops to 40 ms: 4 × 40 + 140 = 300 ms.
How Is Website Speed Measured?
There are two kinds of measurement, and they complement each other: lab measurement gives repeatable results in a controlled setup, while real user data shows what visitors experience. Look at both before deciding.
- Lab measurement: Browser developer tools or a lab measurement tool assume a fixed device and network. It is ideal for debugging, but a single run is noisy; take the median of at least five runs (1.31, 1.18, 1.52, 1.24, 1.29 s gives a median of 1.29 s).
- Real user data: Measurements collected from visitors' browsers. They reflect the variety of devices, networks and locations; in Google's documentation, assessment uses the 75th percentile.
The "good" thresholds Google publishes for the three metrics are: largest contentful paint (LCP) at or under 2.5 s, interaction to next paint (INP) at or under 200 ms, and cumulative layout shift (CLS) at or under 0.1. Thresholds can change; check Google's web developer documentation for current values.
The gap is not small. Say ten visits have LCP values (ms) of 1,400, 1,800, 2,100, 2,300, 2,600, 2,900, 3,100, 3,600, 4,200 and 5,800. The mean is 2,980 and the median is 2,750 ms; the 75th percentile (nearest-rank method, 10 × 0.75 = 7.5, so the 8th value) is 3,600 ms. A page that shows 1.4 s on the developer's laptop is slower than 3.6 s for a quarter of visitors and misses the "good" threshold.
We recommend reading: How to do SEO: a seven-lesson practical guide
How Do You Calculate a Page Weight Budget?
A budget is the largest transfer size allowed per resource type, and download time is size ÷ speed. The example below assumes a mid-range phone opening a product list page on a connection of about 1.6 Mbit/s (representative); 1 KB is taken as 8 kbit, and latency and parse time are excluded, so real time is longer.
| Resource | Before (KB) | After (KB) | What was done |
|---|---|---|---|
| HTML | 70 | 70 | Unchanged |
| CSS | 160 | 90 | Unused rules removed |
| JavaScript | 1,100 | 535 | Dead code and two scripts removed |
| Fonts | 280 | 56 | Subset, two weights |
| Images | 1,800 | 168 | Size, format, lazy loading |
| Other | 90 | 90 | Unchanged |
| Total | 3,500 | 1,009 | −71.2% |
Transfer time is 3,500 × 8 ÷ 1,600 = 17.5 s before and 1,009 × 8 ÷ 1,600 ≈ 5.0 s after (−71.2%). We set a first-load budget of 1,000 KB; the "After" column approaches it. The six images not loaded on first load (6 × 56 = 336 KB) arrive as the user scrolls.
How Do You Make Images Smaller?
Images are the biggest item on most pages; three moves apply in order: scale to the displayed size, convert to a modern format, and defer the ones below the fold.
- Right size: An image uploaded at 2,000 pixels wide and shown at 800 carries wasted bytes. In the example a 200 KB image shrinks to 80 KB at display size (−60%; file size is not strictly proportional to pixel count, and the real ratio varies with content).
- Modern format: Assuming a more efficient format shrinks the same image by about 30%: 80 × 0.7 = 56 KB. Keep a fallback format for older browsers.
- Lazy loading: Of 9 images, only the 3 above the fold download immediately: 3 × 56 = 168 KB; the other 6 come later.
In total: from 9 × 200 = 1,800 KB to 9 × 56 = 504 KB (−72%), and 168 KB on first load. The main image above the fold is not lazy loaded; it is given priority and appears directly in the HTML. A lazy-loaded hero image is the most common cause of delayed largest content.
How Do Fonts and CSS Affect Speed?
Font files and render-blocking CSS directly delay the moment text appears on screen.
- Subset: Use a file with only the characters you need (Latin and Turkish). In the example, 2 weights × 28 = 56 KB instead of 4 files × 70 = 280 KB.
- font-display: Show the text in a fallback font until the real font arrives; do not wait with invisible text.
- Critical CSS: Inlining the rules needed for the first screen and deferring the rest brings the first paint forward. Removing unused rules took the example from 160 KB to 90 KB.
How Do JavaScript and Third-Party Scripts Slow a Page?
The cost of JavaScript is not only download but also parsing and execution; this work runs on the main thread and blocks interaction. The cost multiplies on weak devices: execution that takes 150 ms on a developer laptop takes 600 ms on a phone 4 times slower (representative multiplier; measurement tools offer a CPU throttling setting).
If 45% of the 700 KB in your own code is unused (found by code coverage measurement), you can drop to 700 × 0.55 = 385 KB. Third-party scripts need separate handling; each carries its own cost.
| Script | Main thread (ms) | Decision |
|---|---|---|
| Live chat | 180 | Defer until first interaction |
| Analytics | 60 | Keep |
| Advertising | 220 | Keep, load late |
| Heat map | 140 | Remove |
| Social buttons | 90 | Remove |
| Total | 690 | Saved 410, 280 left |
Total blocking time is the sum of the parts of tasks that exceed 50 ms. If five tasks take 120, 80, 65, 210 and 55 ms: 70 + 30 + 15 + 160 + 5 = 280 ms. Ask each script: what does it add, and is that worth its cost? When a change touches cookies or measurement code, settle personal data and cookie consent questions with your legal counsel.
Which Network and Server Settings Increase Speed?
Four settings reduce byte count and request waiting; most are one-time configuration.
- Compression: Text resources (HTML, CSS, JavaScript) are sent compressed. A 300 KB file that shrinks 70% becomes 90 KB; the ratio varies with content.
- Cache headers: Give long-lived validity to files whose names contain a content hash and short validity to HTML. If a second visit downloads only the HTML (70 KB) and 90 KB of "other", the page opens in 160 × 8 ÷ 1,600 = 0.8 s; the first visit took 5.0 s.
- HTTP/2 and a CDN: Carrying many requests on one connection and serving content from a point near the visitor reduces connection and first-byte time (the 700 ms to 300 ms example above).
- First byte: If the server builds the page slowly, fix that first; for the query side see our database indexing guide.
You see the effect of these settings in largest content time. LCP has four parts: first byte, the delay until the resource is discovered, the resource download, and the time until it is painted.
| LCP part | Before (ms) | After (ms) |
|---|---|---|
| First byte | 700 | 300 |
| Resource discovery | 800 | 150 |
| Resource download | 1,000 | 350 |
| Until paint | 500 | 250 |
| Total | 3,000 | 1,050 |
Before, the main image (200 KB) was added by a script, so it was discovered late; the download takes 200 × 8 ÷ 1,600 = 1,000 ms. After, the image is in the HTML and 56 KB; 3,000 to 1,050 ms (−65%). The page moved from above the 2,500 ms threshold to below it.
How Do You Fix Layout Shift and Interaction Delay?
Layout shift happens when content loads late and pushes what is below it down; interaction delay is a tap waiting while the main thread is busy.
The shift score is impact fraction × distance fraction. If a block covering half the screen is pushed down by 25% of the screen height because of a late-loading area, the impact fraction is 0.5 + 0.25 = 0.75 and the score is 0.75 × 0.25 = 0.1875. Add 0.02 from a font swap and the total is 0.2075, above the 0.1 threshold. Causes and fixes:
- Image with no dimensions: set width and height or an aspect ratio.
- Late-arriving ad or banner: reserve the height of the slot in advance.
- Font swap: choose a fallback font with similar metrics.
With these three fixed, the score in the example falls to 0.02. For interaction, INP has three parts: input delay + processing + presentation. A tap on a filter button that takes 120 + 180 + 60 = 360 ms is above the 200 ms threshold; once the main thread is freed and processing is shortened, it becomes 20 + 90 + 40 = 150 ms. For accessibility and interaction design see our UX design guide and our web accessibility article.
How Is a Speed Improvement Project Run?
Scattered optimizations are reversed quickly; a six-step flow makes the gain last.
- Measure: Record the 75th percentile from real user data and the median of five lab runs.
- Set a budget: Write KB per resource type and a threshold per metric.
- Shrink images: They are the biggest item, so they come first.
- Reduce scripts: Remove dead code and scripts that add no value.
- Tune the network: Compression, cache headers, CDN.
- Check the budget: Automatic measurement in every release, with an alert on deviation.
The last step protects the gain. For example, with a JavaScript budget of 600 KB, if a developer adds an 85 KB library the total becomes 535 + 85 = 620 KB and the release pipeline fails; the increase is (620 − 535) ÷ 535 ≈ 15.9%. For monitoring in production see our software monitoring guide.
We recommend reading: How to build a corporate website: planning, design, SEO and speed guide
How Do You Calculate the Payback of a Speed Improvement?
We do not give a general ratio between speed and conversion; an unsourced percentage would mislead. Split releases into two groups (A/B) on your own site and measure the real effect. The calculation below uses an assumption only to show the method.
Say 100,000 visitors per month, conversion 2.0% (2,000 orders) and a contribution margin of ₺150 per order. Assume the speed improvement lifts conversion to 2.1% (representative): +100 orders × ₺150 = ₺15,000/month. Investment is 12 person-days × ₺9,000 = ₺108,000; extra monitoring and maintenance is ₺3,000 per month. Net monthly gain is ₺12,000, and payback is 108,000 ÷ 12,000 = 9 months. If the lift halves to 2.05%, it is +50 orders = ₺7,500, net ₺4,500, and payback is 24 months. If conversion does not change at all, the improvement brings no orders. You can find the cost items in our software project cost guide.
What Mistakes Are Common in Speed Work?
- Looking only at the lab: A fast laptop measurement does not reflect real visitors.
- Lazy loading the main image: It delays the largest content.
- Adding scripts without questioning them: Every extra script loads the main thread.
- Not checking the budget: The improvement is lost again within a few releases.
We recommend reading: What Is a Design System and How Do You Build One? Tokens, Components, Versioning and Payback
We recommend reading: How to Improve Ecommerce Checkout: Step Conversion, Form Fields, Payment Errors and Payback Guide
We recommend reading: How to Manage Bot Traffic and Automated Abuse: Signal Scoring, Rate Limits and Payback Guide
We recommend reading: How to Add Structured Data (Schema Markup, JSON-LD): Types, Validation and Payback Guide
We recommend reading: What Is a Headless CMS? CMS vs Headless, Content Model, Workflow and Cost Guide
We recommend reading: How to Set Up Cookie Consent Management: Cookie Policy, Banner, Tag Loading and Measurement Impact Guide
We recommend reading: How to Build a Landing Page: One Goal, Message Match, Form and Measurement Guide
We recommend reading: How to Migrate a Website Without Losing SEO: 301 Redirects, URL Mapping, Launch Day and Monitoring Guide
Fast Web Software with İnovabil
At İnovabil our focus is bespoke software built from scratch for your company, and web software is part of it. We built our own site with a measured speed and accessibility target: on a phone Lighthouse run, speed 97–100, accessibility 100 and 12 different structured data types (measured on our own site; we make no other speed claim). The same approach includes writing the speed target and the budget down at the analysis stage.
We built CRM, purchasing and mobile for Avcılar İnşaat; a purchasing system for İZBAN; logistics and shipment planning with wholesale order management for Karyak; and warehouse management plus a complaint and support management system for Sleepy. Send us a short summary of your web project, and we will write the speed targets and the budget together.
We recommend reading: Our web development service
Frequently Asked Questions
How do you improve website speed?
First find where the slowness is with real user data; then shrink images, remove unused scripts and scripts that add no value, subset fonts, set compression and cache headers, fix the causes of layout shift, and check the budget in every release.
What are the Core Web Vitals thresholds?
The "good" thresholds Google publishes: largest contentful paint (LCP) at or under 2.5 s, interaction to next paint (INP) at or under 200 ms, and cumulative layout shift (CLS) at or under 0.1. Check Google's web developer documentation for current values.
Should you rely on lab measurement or real user data?
Both; lab measurement is for debugging and real user data is for setting priorities. In the example, a page that shows 1.4 s in the lab has a 75th percentile of 3.6 s.
How much does speed increase conversion?
We do not give a general ratio. Run an A/B measurement on your own site. In the example, payback is 9 months if conversion rises from 2.0% to 2.1% and 24 months if the lift halves; the figures are representative.
How is a speed budget enforced?
You write a size per resource type and a threshold per metric; automatic measurement runs in the release pipeline and warns or stops the release when the budget is exceeded. In lab measurement, use the median of several runs instead of a single result.