Home » Speed & Mobile » Slow Server Response Time (TTFB): Find Where the Wait Comes From
Slow Server Response Time (TTFB): Find Where the Wait Comes From
Time to first byte (TTFB) is how long a visitor waits between asking for a page and receiving the first piece of the reply. Until it arrives, the browser shows nothing, so a slow TTFB delays everything else. Google's web.dev guidance treats 0.8 seconds or less as good and more than 1.8 seconds as poor. This guide helps you find which part of the wait is yours to fix.
Step 1: measure it
This curl command splits the delay into stages:
curl -o /dev/null -s -w "dns: %{time_namelookup}\nconnect: %{time_connect}\ntls: %{time_appconnect}\nttfb: %{time_starttransfer}\ntotal: %{time_total}\n" https://example.com/
On Windows PowerShell, use curl.exe and replace /dev/null with NUL. Run it three times and note the pattern:
| Result | Likely cause |
|---|---|
dns is high |
Slow DNS provider, see DNS troubleshooting |
connect or tls is high |
Server far from the visitor, or a slow TLS setup |
Big gap between tls and ttfb |
The server is slow to build the page (most common) |
| Slow once, fast after | Missing page cache |
Step 2: turn on page caching
For most sites, the biggest win is serving a saved copy of each page instead of rebuilding it for every visitor. WordPress sites can use a caching plugin or the host's built-in cache. Static or custom sites can use server-level caching. See No Caching or Compression for the headers to set. After enabling it, rerun the curl test and compare.
Step 3: check the hosting plan
Cheap shared hosting often slows down when other sites on the same server are busy. Signs: TTFB changes a lot between runs and at different times of day. Check your host's control panel for CPU, memory and process limits being hit. If limits are the issue, move to a higher plan or a VPS or managed host, and keep the PHP version current, since newer supported versions are usually faster.
Step 4: look at the database and plugins
If pages are dynamic (WordPress, shops, logged-in areas), the slow part is often database queries or heavy plugins. Safe approach:
- Take a backup.
- On a staging copy, deactivate plugins in groups and retest TTFB.
- Remove plugins you do not use, and replace any that make slow external calls on every page.
- Clean up large tables such as old post revisions, expired transients and logs.
A plugin like Query Monitor shows which queries and plugins take the longest on a given page.
Step 5: use a CDN where it fits
A CDN (content delivery network) keeps copies of your pages and files in many locations. It helps most when it can cache full pages. Combine it with the caching from Step 2 and test again from a location far from your server.
Common mistakes
- Optimising images when the real delay is the server (images affect load time, not TTFB; see Large Unoptimized Images for that separate problem).
- Testing only once. A single run can be unrepresentative, so repeat it.
- Testing while logged in to WordPress, which usually bypasses the cache.
- Adding several caching plugins that conflict with each other.
- Buying a bigger plan without first checking whether caching is on.
Frequently Asked Questions
What is a good TTFB?
Google's web.dev guidance treats a TTFB of 0.8 seconds or less as good and over 1.8 seconds as poor, measured for real visitors. Lower is better, and a cached page should usually be far under that.
Does a CDN fix a slow TTFB?
It helps when the CDN can serve a cached copy of the page. If every request still has to reach a slow origin server to build the page, the CDN cannot hide that wait.
Why is only my first visit slow?
That usually means pages are generated on demand and not cached, so the first request after a cache expires does all the work. Page caching or a longer cache lifetime fixes it.
Found a mistake or still stuck? Contact us. See how we write and check these guides in our editorial policy, or read about DocumentGuy.