Contents

Time to First Byte explained: how to measure and improve TTFB

Fast loading times are a decisive factor for the satisfaction of website visitors and for search engine optimisation. Time to First Byte (TTFB) plays a central role in this. This article provides a comprehensive insight into the importance of TTFB and shows practical ways to measure this metric and which measures can be taken to improve it.

Author: Christopher Christopher   | 23 May 2024
Time to First Byte explained: how to measure and improve TTFB

Google Gemini

    What is TTFB?

    The Time to First Byte (TTFB) is a web performance metric that measures the time from the browser sending a request to receiving the first byte of the response from the server. TTFB consists of three main components:

    • DNS lookup: Before the browser can send a request to the server, it must resolve the IP address of the domain, which is known as a DNS lookup. This process can take varying amounts of time depending on the DNS server.
    • Server processing: Once the request reaches the server, it must be processed. If the connection is over HTTPS, the SSL handshake is performed first. During this, the browser and server exchange cryptographic keys to establish a secure connection. The server then handles the request, which can include database queries, rendering page content and generating the HTTP response. The efficiency and performance of the server have a significant impact on the duration of this step.
    • Network transmission: After the server has generated the response, it is sent back over the network to the browser. The speed and reliability of the network connection play a decisive role in this.

    TTFB is a crucial factor in the overall performance of a website and directly affects the user experience. A long TTFB can lead to delayed page load times, increasing the likelihood that users will leave the site before it has fully loaded. This can negatively impact bounce rate and user satisfaction. In addition, TTFB plays a role in search engine optimisation (SEO), as search engines such as Google take loading speed into account as a ranking factor.

     

    Distinction from other performance metrics

    Page speed generally refers to the time a website takes to fully load. While TTFB measures the time until the first byte is received, other performance metrics focus on different aspects of load time. First Contentful Paint (FCP) measures, for example, the time until the browser first renders content (e.g. text, images) to the screen. This gives users visual feedback that the page has begun loading. Largest Contentful Paint (LCP), by contrast, measures the time until the largest visible element on the page is fully loaded. This is regarded as an important indicator of perceived loading speed and user experience.

     

    TTFB is therefore a fundamental metric that measures the initial server response time or is part of the overall server speed, while FCP and LCP provide further insight into the actual user experience during page rendering. Together, all these metrics help to understand and optimise a website's performance holistically.

     

    Which factors influence TTFB?

    There are several factors that influence the Time to First Byte (TTFB):

    Server performance and hosting environment

    The server's performance and the quality of the hosting environment have a significant impact on TTFB. High-quality hardware such as fast processors, sufficient RAM and SSDs can significantly improve server response times. Furthermore, the type of hosting matters: Dedicated Server offer better performance than shared Web hosting packages, as resources do not need to be shared with other websites.

    Network conditions and latency

    The network conditions between the server and the end user significantly affect TTFB. High latency, caused by long physical distances due to the geographical location of the server or poor network connections, can increase the time a data packet needs to travel from the user to the server and back. Factors such as network congestion and inefficient routing processes can also increase latency and thus negatively affect TTFB.

    DNS resolvers and their efficiency

    The DNS resolver, which is responsible for resolving domain names into IP addresses, can also influence TTFB. A slow or inefficient DNS resolver increases the time required for the DNS lookup and therefore raises the TTFB. Choosing a fast and reliable DNS resolver, as well as implementing DNS caching techniques, can improve performance and reduce TTFB.

    Server configuration and optimisation

    Server configuration and optimisation play a key role in influencing TTFB. Implementing caching mechanisms at both the server and application level can allow repeated requests to be answered more quickly. Techniques such as opcode caching (e.g. APC, OPcache) and page caching (e.g. Varnish) can substantially reduce server response times. The use of compression techniques such as Gzip or Brotli reduces the size of the data the server needs to send to the browser, thereby speeding up data transfer. The selection and configuration of web server software (e.g. Apache or Nginx) can affect performance. Optimisations such as Keep-Alive connections, minimising modules and adjusting timeout settings also contribute to reducing TTFB.

    Impact of CDNs (Content Delivery Networks) on TTFB

    CDNs play an important role in reducing TTFB by delivering content from geographically distributed servers. By caching static content such as images, JavaScript files and stylesheets in data centres closer to the end user, CDNs can significantly shorten latency. This leads to faster content delivery and reduced TTFB. CDNs also offload the origin server, improving its performance and further reducing server response times.

     

    How can TTFB be measured?

    TTFB can be measured using specialised web analytics tools or browser developer tools:

    Website analytics tools provide comprehensive insights into a website's performance, including TTFB. Two of the best-known tools are:

    Uptrends Website Speed Test: This free tool enables detailed performance tests of websites from various geographic locations and under different network conditions. Uptrends Website Speed Test provides detailed reports on page load times, including TTFB. It also displays a waterfall chart view that visualises the different loading phases and their durations.

    ttfb-messen-uptrends-pagespeedtest

    Google PageSpeed Insights: This tool assesses a website's performance for both mobile devices and desktop computers. It provides specific recommendations for improving load times and Google PageSpeed Insights displays TTFB as part of its metrics.

    ttfb-messen-google-page-insights

    Modern web browsers include built-in developer tools that enable detailed analysis of website performance:

    Google Chrome DevTools: In the Network tab of Chrome DevTools, the load times of all resources, including TTFB, can be analysed. It shows a detailed waterfall view that visualises the different loading phases of resources and indicates the duration of each phase.

    ttfb-messen-chrome-entwicklertools

    Firefox Developer Tools: Similar to Chrome DevTools, Firefox also offers detailed analysis of network requests, including TTFB. The Network view allows you to monitor and analyse the load times of individual resources.

    ttfb-messen-firefox-entwicklertools

     

    Which TTFB values are good?

    The following guideline values for TTFB are considered good, average or poor:

    0 to 300 milliseconds: A TTFB in this range is considered good. Websites that achieve this speed provide users with a very fast initial response and an overall better load speed.

    300 to 500 milliseconds: A TTFB in this range is considered average. Most users will not experience noticeable delays, and the website's performance will be satisfactory in most cases. However, there is room for improvement.

    over 500 milliseconds: A TTFB in this range is considered poor and indicates that optimisation is required. Users may notice longer load times, which can negatively affect the user experience.

     

    Find out which web host performs best for TTFB in our performance test:

    The fastest web hosting providers from our test

    Provider TTFB LCP Pagespeed Uptime Overall Score
    ALL-INKL.COM - Neue Medien Münnich 0,341 s 1,600 s 0,446 s 100,00 % EXCELLENT
    DreamHost 0,133 s 1,500 s 0,294 s 100,00 % EXCELLENT
    Cloud86 0,077 s 0,900 s 0,167 s 100,00 % EXCELLENT
    IP-Projects GmbH & Co. KG 0,200 s 1,100 s 0,271 s 100,00 % EXCELLENT
    netcup 0,576 s 1,330 s 0,178 s 100,00 % VERY GOOD
    As of: April 2026 | Our Testing Methodology

     

    How can TTFB be improved?

    TTFB can be optimised by implementing various measures:

     

    Selecting a high-performance hosting provider

    A high-performance hosting provider lays the foundation for a low TTFB. Criteria for selecting a suitable provider include:

    • Server hardware: High-quality hardware such as fast processors, sufficient RAM and SSDs contributes to faster data processing and shorter response times.
    • Infrastructure: Modern data centres with redundant networks and power supplies increase reliability and performance.
    • Location: Servers placed geographically closer to users reduce latency and improve TTFB.

     

    Optimising the server infrastructure

    Optimising the server infrastructure is crucial for reducing TTFB. Key measures include:

     

    Reducing server response times by optimising server software

    Server software can be improved through various optimisations:

    • Configuration of Apache and Nginx: Optimisations such as enabling Keep-Alive connections, reducing the number of modules and adjusting timeout settings can shorten server response times.
    • Use of HTTP/2: HTTP/2 offers a more efficient transmission of data, reduces latency and improves TTFB.
    • SSL/TLS optimisations: Using modern SSL/TLS protocols and implementing TLS 1.3 can reduce SSL handshake times.

     

    Using CDNs to reduce latency

    Content Delivery Networks (CDNs) store static content on servers distributed worldwide and deliver it from the location closest to the user. Benefits of CDNs include:

     

    Implementing caching strategies

    Caching strategies can significantly improve TTFB by serving frequently requested content more quickly:

    • Browser caching: By setting Cache-Control headers, content can be cached in the user's browser so it does not need to be reloaded from the server on repeated requests.
    • Server-side caching: Techniques such as opcode caching (e.g. OPcache) and page caching (e.g. Varnish) store preprocessed content on the server and deliver it faster without needing to be regenerated.

     

    Optimising DNS resolution and configuration

    Efficient DNS resolution and configuration contribute to improving TTFB:

    • Fast DNS resolvers: Using fast and reliable DNS resolvers reduces DNS lookup times.
    • DNS caching: DNS caching can speed up repeated DNS queries, as the results are cached locally.
    • Reduction of DNS lookups: Minimising the number of DNS lookups, e.g. by consolidating resources onto fewer domains, can reduce overall load time.

     

    Minimising database queries and optimising database performance

    Efficient database operations are crucial for fast server response times:

    • Reducing the number of queries: Consolidating database queries and avoiding unnecessary queries can reduce database load.
    • Database indexes: Creating appropriate indexes speeds up searching and data access.
    • Database caching: Using caching techniques such as Memcached or Redis can improve the performance of database-driven applications by keeping frequently used data in memory for faster retrieval.

     

    A fast Time to First Byte (TTFB) is crucial for a positive user experience and good search engine ranking. The key measures to optimise include choosing a high-performance hosting provider, using CDNs and efficient caching strategies. Continuous monitoring and regular optimisation of TTFB are essential to ensure the long-term performance of the website and remain competitive.

    Find out about the fastest web hosts in Germany and how they perform on Time to First Byte (TTFB).

     

    Our article is based on our own experience and research as well as information from external sources.

    Quellenangaben & weiterführende Links zum Thema:
    https://www.uptrends.com/tools/website-speed-test (Uptrends Webspeed Test)
    https://pagespeed.web.dev/ (Google Pagespeed Insights)
    https://web.dev/articles/optimize-ttfb?hl=de (Information on TTFB from Google Chrome developers)

    Write a comment


    More web hosts


    More interesting articles

    Server Response Time explained: measuring and improving server response time

    In this article we explain why Server Response Time is so important, how it is measured and how it can be improved.

    What are Load Balancers and how do they work?

    Load Balancers help you distribute a huge load of requests. We show you how this works in practice.

    Pagespeed explained: How to measure and improve website load time

    This article provides a comprehensive overview of the various methods for measuring and optimising website load time.

    Largest Contentful Paint explained: How to measure and improve LCP

    This article provides a comprehensive overview of the importance of LCP and sets out practical ways to measure this metr...

    Gzip vs Brotli: Compression methods compared

    Gzip and Brotli are two compression methods that share the same goal but work differently in detail

    Lazy Loading - What's Behind It?

    The loading times of a website should be as minimal as possible. How exactly can Lazy Loading help with this?