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

      Sunshine And March Vibes (2025 Wallpapers Edition)

      June 1, 2025

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

      June 1, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 1, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 1, 2025

      7 MagSafe accessories that I recommend every iPhone user should have

      June 1, 2025

      I replaced my Kindle with an iPad Mini as my ebook reader – 8 reasons why I don’t regret it

      June 1, 2025

      Windows 11 version 25H2: Everything you need to know about Microsoft’s next OS release

      May 31, 2025

      Elden Ring Nightreign already has a duos Seamless Co-op mod from the creator of the beloved original, and it’ll be “expanded on in the future”

      May 31, 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

      Student Record Android App using SQLite

      June 1, 2025
      Recent

      Student Record Android App using SQLite

      June 1, 2025

      When Array uses less memory than Uint8Array (in V8)

      June 1, 2025

      Laravel 12 Starter Kits: Definite Guide Which to Choose

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

      Photobooth is photobooth software for the Raspberry Pi and PC

      June 1, 2025
      Recent

      Photobooth is photobooth software for the Raspberry Pi and PC

      June 1, 2025

      Le notizie minori del mondo GNU/Linux e dintorni della settimana nr 22/2025

      June 1, 2025

      Rilasciata PorteuX 2.1: Novità e Approfondimenti sulla Distribuzione GNU/Linux Portatile Basata su Slackware

      June 1, 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 

    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)

    June 1, 2025
    Tech & Work

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

    June 1, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    What are some approaches to testing a major software update?

    Development

    Blockchain Development Costs Explained: A Smart Investment for Maximum ROI

    Web Development

    Samsung Galaxy Book4 Edge vs. MacBook Pro (M3): AI ecosystems, ARM performance, and sleek designs

    Development

    How to configure a Linked Server between Amazon RDS for SQL Server and Teradata database

    Databases

    Highlights

    Distribution Release: Kali Linux 2024.4

    December 16, 2024

    The DistroWatch news feed is brought to you by TUXEDO COMPUTERS. The Kali Linux project has announced a new snapshot of the project’s rolling release distribution. The latest version, 2024.4, upgrades Python to version 3.12, drops support for 32-bit x86 kernels and offers GNOME 47. The release announcement offers a summary: “The summary of the changelog since the 2024.3….

    AI-powered assistants for investment research with multi-modal data: An application of Agents for Amazon Bedrock

    June 26, 2024

    TacticAI: an AI assistant for football tactics

    May 27, 2025

    3 ways to connect your phone with Windows now that this popular sync tool is getting the axe

    April 3, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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