Black Friday Sale is live: save up to 85% on Web & WordPress HostingView Deals
Hosting & Server GlossaryPerformance, Caching & Diagnostics

What is TTFB (Time to First Byte)? Measurement & Performance Guide

Definition

TTFB (Time to First Byte) is a foundational web performance metric that measures the time duration from when a client (such as a web browser or mobile app) sends an HTTP/HTTPS network request until it receives the very first byte of response data from the destination web server.

Because a browser cannot begin parsing HTML, discovering stylesheets, or downloading images until the server returns the first byte of the page, TTFB serves as the primary benchmark for raw server responsiveness and initial network latency.


Anatomy of TTFB: What Contributes to the Delay?

TTFB is not a single isolated event; it represents the cumulative sum of multiple sequential network and server phases:

[ Client Request Initiated ]
            │
            ├─ 1. DNS Resolution (Translating domain to IP)
            ├─ 2. TCP Handshake (3-way SYN / ACK connection)
            ├─ 3. TLS Handshake (Cryptographic SSL/TLS negotiation)
            ├─ 4. Request Transmission (Client sends HTTP GET/POST headers)
            ├─ 5. Server Processing (Routing, PHP execution, database queries)
            └─ 6. Network Transit (First response packet travels back to client)
            │
            ▼
[ First Byte Received by Client (TTFB Completed) ]

1. Network & Routing Latency

Before the server can process a request, the client must resolve the domain via DNS, establish a TCP connection, and complete the cryptographic SSL/TLS handshake. Physical geographic distance between the visitor and the server adds round-trip time (RTT) to each of these steps.

2. Server & Application Processing

Once the server receives the request, it must determine how to respond:

  • Cached or Static Content: If a pre-compiled HTML snapshot exists in server RAM or edge cache, the web server immediately transmits the headers and body. Processing time is near zero (1-5 ms).
  • Un-cached Dynamic Applications: On WordPress or Laravel applications, the server must spin up a PHP-FPM worker, execute application logic, run database queries against MySQL, and compile the final template. On complex themes or heavy e-commerce stores, server execution alone can take 500 ms to 2,000+ ms.

3. Network Transit Delay

Once generated, the first TCP packet must travel back across the physical internet from the hosting data center to the client’s device.


How to Accurately Measure TTFB

TTFB can be measured using multiple tools, each serving different diagnostic purposes:

  1. Command-Line Testing with curl: The most precise method to isolate server TTFB without browser interference is using curl’s write-out format. To learn how to execute timing commands across Windows and Linux, read our detailed tutorial: How to Test Website Response Time with curl.
  2. Browser Developer Tools: Press F12 in Chrome, Firefox, or Edge, navigate to the Network tab, click the initial HTML document request, and inspect the Timing tab. TTFB is labeled as Waiting for server response.
  3. Synthetic Lab Tools: Services like WebPageTest, Google PageSpeed Insights, and GTmetrix measure TTFB from standardized test locations globally.

TTFB vs. Full Page Load Time: Understanding the Difference

It is vital to understand that TTFB is not equivalent to full page load speed:

Metric What it Measures User Experience Impact
TTFB Milliseconds until first byte arrives from server. Indicates server speed, database health, and caching efficiency.
FCP (First Contentful Paint) Milliseconds until the browser renders the first text or image on screen. User realizes the page is actively loading.
LCP (Largest Contentful Paint) Milliseconds until the largest visual content element (hero image/headline) is rendered. User sees the primary content and can begin reading.
Total Page Load Seconds until every single tracking pixel, chat widget, and footer script completes. Full background execution completion.

A website can achieve an exceptional 50 ms TTFB, but if its homepage loads 10 MB of uncompressed images and 40 third-party JavaScript tracking scripts, the visitor will still experience an unacceptably slow website. However, you cannot achieve a fast LCP without a fast TTFB as its foundation.


How to Reduce High TTFB on Web Hosting

If your website exhibits high TTFB (exceeding 800 ms):

  1. Enable Server-Level Page Caching: Eliminate dynamic PHP and database queries for public visitors. See how to optimize WordPress with LiteSpeed Cache.
  2. Deploy an Edge CDN: Use a Content Delivery Network to serve cached HTML and static assets from points of presence geographically close to visitors.
  3. Upgrade Server Resources: Ensure your hosting environment provides sufficient vCPU and RAM so concurrent requests do not get queued behind saturated CPU threads.
  4. Optimize Database Queries: Add indexes to heavily queried MySQL tables and clean up transient options.
  5. Choose NVMe SSD Hosting: Rotational HDD and even standard SATA SSD storage introduce random I/O latency for database reads. Hosting plans running on PCIe NVMe SSD deliver lower disk I/O latency, directly benefiting uncached page TTFB. Compare Web Hosting plans and Managed VPS plans that run on NVMe infrastructure.

To see how TTFB looks in practice, run the curl timing test against your current site before and after enabling caching, as it gives a baseline number to measure any improvement against.

Frequently Asked Questions

What is considered a 'good' TTFB score?

According to Google Web Vitals guidance, a TTFB under 800 milliseconds is generally acceptable, while a TTFB under 200 to 300 milliseconds is considered optimal. Static pages served from edge caches or CDNs often achieve TTFBs under 50 milliseconds.

Does a fast TTFB guarantee my website will pass Core Web Vitals?

No. TTFB is only the starting gun. A fast TTFB means the server responded quickly with the initial HTML, but total page speed and user experience also depend on Largest Contentful Paint (LCP), Cumulative Layout Shift (CLS), and Interaction to Next Paint (INP), which reflect image rendering, stylesheet execution, and JavaScript execution.

Why is TTFB much slower on dynamic pages than on static pages?

On dynamic pages (such as an un-cached WordPress page or e-commerce cart), the server must execute PHP code, query MySQL databases, and assemble the HTML document before sending the first byte. Static pages bypass PHP and database execution entirely, streaming pre-built files immediately.

Need Technical Assistance?

Web Hosting Wale support is available 24/7. Tickets are typically answered within 10-15 minutes.

Open Support TicketView All Support Channels