Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 30, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 30, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 30, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 30, 2025

      Does Elden Ring Nightreign have crossplay or cross-platform play?

      May 30, 2025

      Cyberpunk 2077 sequel enters pre-production as Phantom Liberty crosses 10 million copies sold

      May 30, 2025

      EA has canceled yet another game, shuttered its developer, and started more layoffs

      May 30, 2025

      The Witcher 3: Wild Hunt reaches 60 million copies sold as work continues on The Witcher 4

      May 30, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      How Remix is shaking things up

      May 30, 2025
      Recent

      How Remix is shaking things up

      May 30, 2025

      Perficient at Kscope25: Let’s Meet in Texas!

      May 30, 2025

      Salesforce + Informatica: What It Means for Data Cloud and Our Customers

      May 30, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Does Elden Ring Nightreign have crossplay or cross-platform play?

      May 30, 2025
      Recent

      Does Elden Ring Nightreign have crossplay or cross-platform play?

      May 30, 2025

      Cyberpunk 2077 sequel enters pre-production as Phantom Liberty crosses 10 million copies sold

      May 30, 2025

      EA has canceled yet another game, shuttered its developer, and started more layoffs

      May 30, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Tech & Work»Time To First Byte: Beyond Server Response Time

    Time To First Byte: Beyond Server Response Time

    February 13, 2025

    This article is a sponsored by DebugBear

    Loading your website HTML quickly has a big impact on visitor experience. After all, no page content can be displayed until after the first chunk of the HTML has been loaded. That’s why the Time to First Byte (TTFB) metric is important: it measures how soon after navigation the browser starts receiving the HTML response.

    Generating the HTML document quickly plays a big part in minimizing TTFB delays. But actually, there’s a lot more to optimizing this metric. In this article, we’ll take a look at what else can cause poor TTFB and what you can do to fix it.

    What Components Make Up The Time To First Byte Metric?

    TTFB stands for Time to First Byte. But where does it measure from?

    Different tools handle this differently. Some only count the time spent sending the HTTP request and getting a response, ignoring everything else that needs to happen first before the resource can be loaded. However, when looking at Google’s Core Web Vitals, TTFB starts from the time when the users start navigating to a new page. That means TTFB includes:

    • Cross-origin redirects,
    • Time spent connecting to the server,
    • Same-origin redirects, and
    • The actual request for the HTML document.

    We can see an example of this in this request waterfall visualization.

    The server response time here is only 183 milliseconds, or about 12% of the overall TTFB metric. Half of the time is instead spent on a cross-origin redirect — a separate HTTP request that returns a redirect response before we can even make the request that returns the website’s HTML code. And when we make that request, most of the time is spent on establishing the server connection.

    Connecting to a server on the web typically takes three round trips on the network:

    1. DNS: Looking up the server IP address.
    2. TCP: Establishing a reliable connection to the server.
    3. TLS: Creating a secure encrypted connection.

    What Network Latency Means For Time To First Byte

    Let’s add up all the network round trips in the example above:

    • 2 server connections: 6 round trips.
    • 2 HTTP requests: 2 round trips.

    That means that before we even get the first response byte for our page we actually have to send data back and forth between the browser and a server eight times!

    That’s where network latency comes in, or network round trip time (RTT) if we look at the time it takes to send data to a server and receive a response in the browser. On a high-latency connection with a 150 millisecond RTT, making those eight round trips will take 1.2 seconds. So, even if the server always responds instantly, we can’t get a TTFB lower than that number.

    Network latency depends a lot on the geographic distances between the visitor’s device and the server the browser is connecting to. You can see the impact of that in practice by running a global TTFB test on a website. Here, I’ve tested a website that’s hosted in Brazil. We get good TTFB scores when testing from Brazil and the US East Coast. However, visitors from Europe, Asia, or Australia wait a while for the website to load.

    What Content Delivery Networks Mean for Time to First Byte

    Hostinger

    One way to speed up your website is by using a Content Delivery Network (CDN). These services provide a network of globally distributed server locations. Instead of each round trip going all the way to where your web application is hosted, browsers instead connect to a nearby CDN server (called an edge node). That greatly reduces the time spent on establishing the server connection, improving your overall TTFB metric.

    By default, the actual HTML request still has to be sent to your web app. However, if your content isn’t dynamic, you can also cache responses at the CDN edge node. That way, the request can be served entirely through the CDN instead of data traveling all across the world.

    If we run a TTFB test on a website that uses a CDN, we can see that each server response comes from a regional data center close to where the request was made. In many cases, we get a TTFB of under 200 milliseconds, thanks to the response already being cached at the edge node.

    How To Improve Time To First Byte

    What you need to do to improve your website’s TTFB score depends on what its biggest contributing component is.

    • A lot of time is spent establishing the connection: Use a global CDN.
    • The server response is slow: Optimize your application code or cache the response
    • Redirects delay TTFB: Avoid chaining redirects and optimize the server returning the redirect response.

    Keep in mind that TTFB depends on how visitors are accessing your website. For example, if they are logged into your application, the page content probably can’t be served from the cache. You may also see a spike in TTFB when running an ad campaign, as visitors are redirected through a click-tracking server.

    Monitor Real User Time To First Byte

    If you want to get a breakdown of what TTFB looks like for different visitors on your website, you need real user monitoring. That way, you can break down how visitor location, login status, or the referrer domain impact real user experience.

    DebugBear can help you collect real user metrics for Time to First Byte, Google Core Web Vitals, and other page speed metrics. You can track individual TTFB components like TCP duration or redirect time and break down website performance by country, ad campaign, and more.

    Conclusion

    By looking at everything that’s involved in serving the first byte of a website to a visitor, we’ve seen that just reducing server response time isn’t enough and often won’t even be the most impactful change you can make on your website.

    Just because your website is fast in one location doesn’t mean it’s fast for everyone, as website speed varies based on where the visitor is accessing your site from.

    Content Delivery Networks are an incredibly powerful way to improve TTFB. Even if you don’t use any of their advanced features, just using their global server network saves a lot of time when establishing a server connection.

    Source: Read More 

    Hostinger
    news
    Facebook Twitter Reddit Email Copy Link
    Previous ArticleHow AI-driven identify fraud is causing havoc
    Next Article nutgram/nutgram

    Related Posts

    Tech & Work

    Sunshine And March Vibes (2025 Wallpapers Edition)

    May 30, 2025
    Tech & Work

    The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

    May 30, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Microsoft might kill the Surface Laptop Studio as production is quietly halted

    News & Updates

    Russian hackers read the emails you sent us, Microsoft warns more customers

    Development

    Arriva la Beta di Fedora 42: KDE edizione principale, spin COSMIC e nuova versione di Anaconda

    Linux

    Snipping Tool’s Paint 3D Icon is not Working Automatically

    Development

    Highlights

    The Return of the UX Generalis

    May 6, 2025

    For years, our industry has debated (and sometimes derided) the concept of the “UX unicorn,”…

    Avowed Keeps Crashing: How to Permanently Stop it

    February 25, 2025

    Big O notation: Avoiding common performance pitfalls

    March 16, 2025

    How to Conduct a Design Audit That Actually Improves Your Product

    February 24, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.