• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Time To First Byte (TTFB) Demystified

By Abhishek Ghosh August 21, 2014 12:49 pm Updated on August 21, 2014

Time To First Byte (TTFB) Demystified

Advertisement

In this article on Time To First Byte (TTFB), we have explained the relationship with good host, latency, CDN and how to know TTFB with cURL. Usually uneducated peoples who were last benchers in school found SEO is a way make quick money. Most has not a single masters’ degree on science. Practically the things are logical. Rocket science is nothing but Newton’s Law! Time To First Byte (TTFB) is mostly theoretical, it is usually higher for any CMS, blogging software including WordPress without tweaking. It is near impossible to measure using another server – except some command line tools, invariably it will show falsely higher or lower value.

 

Time To First Byte (TTFB) : Basics

 

For example, you using a cache plugin in WordPress, compressing to almost kill your server, it will definitely deliver a compressed HTML page with lower Time To First Byte (TTFB), but there is no warranty that a person living opposite the globe is not receiving a blank white page – quite common with PHP-MySQL based softwares. Time To First Byte (TTFB) has nothing to do with SERP. Google calculates the total rendering time. It is practically near impossible to get a Time To First Byte (TTFB) lesser than 100ms from geographically located place which is exactly residing opposite to the main server’s data center – thats too assuming a setup with all dedicated hardware and networking tools. If you test a plaintext’s URL, technically it will be the least possible Time To First Byte (TTFB) for your setup. This is for the MIME Type. For streaming media specific CDNs, the Edge Servers are optimized differently for delivering iOS specific stuffs. None possibly uses a text file for the whole website. HTML is the practical type.

Time To First Byte (TTFB) Demystified

As the process to GET a webpage is not one way, but our browsers, Internet Connection Speed, ISP – all matters like in a typical client server model, we can list these factors behind Time To First Byte (TTFB) :

Advertisement

---

Client Factors :

  1. DNS Lookup Time (again is dependent on many parameters)
  2. Initial Connection Time (dependent on many parameters)
  3. Opening connection (dependent on many parameters)
  4. Receipt of Data and recheck
  5. Closing the connection

 

Server and Host Factors (Hardware) :

  1. Disk IO
  2. Swap and RAM
  3. Networking

 

Server and Host Factors (Software) :

  1. Web server software configuration
  2. Dynamic language like PHP or other language’s settings
  3. Application server and software’s (Like MySQL) settings
  4. Operating system settings

 

Server and Host Factors (Front-end Software) :

  1. WordPress rendered page will take more time to load than a plain PHP file
  2. WordPress rendered page without cache will take more time to load than a WordPress rendered page with cache
  3. WordPress rendered page without CDN will take more time to load than a WordPress rendered page with CDN

 

There is no technology yet to deliver an Apache or Ngnix rendered PHP pages from geographically distributed way – CDN can only serve the static contents. Loadbalancers are used to fight with this issue. Unfortunately, if you deliver embedded images from CDN, there will be loss in terms of SEO. Google Images supply a good number of visitors without much effort and there is no Advert unlike Web search result. So, CDN is practical only for Javascripts, Theme images, CSS files etc.

Any good web host – be it Amazon, Rackspace or HP – all will give an acceptable Time To First Byte (TTFB). All bigger brands uses Akamai – that is Rackspace Cloud Files for us, we only need to test the WordPress default license.txt file and another set of pages with variable number of embedded images. You have to test from another server on the same data center and from your location. Do not consider Time To First Byte (TTFB) too seriously, it is better to consider the total page loading time. With TLS certificate, on HTTPS URLs, Time To First Byte (TTFB) will become higher. If you test naked IP, Time To First Byte (TTFB) will be lower. Low TTFB on a site with useful for servers under heavy traffic loads.

 

Time To First Byte (TTFB) : Test With cURL

 

Everyone knows what is cURL. Except Microsoft Windows, cURL is usually installed by default. Windows users need to follow this guide to install cURL in Windows to run cURL commands.

You can run command in this format :

Vim
1
curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" https://thecustomizewindows.com/license.txt

You will get return like this :

Vim
1
2
3
4
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 19930  100 19930    0     0   6799      0  0:00:02  0:00:02 --:--:--  6797
Connect: 1.010 TTFB: 2.551 Total time: 2.931

Another method is described by Joseph Scott, first you need to write a text in cURL format :

Vim
1
2
3
4
5
6
7
8
9
10
n
            time_namelookup:  %{time_namelookup}n
               time_connect:  %{time_connect}n
            time_appconnect:  %{time_appconnect}n
           time_pretransfer:  %{time_pretransfer}n
              time_redirect:  %{time_redirect}n
         time_starttransfer:  %{time_starttransfer}n
                            ----------n
                 time_total:  %{time_total}n
n

If we give this file a name like ttfb.txt, then the set of commands on *nix system will be :

Vim
1
2
3
4
5
nano ttfb.txt
# paste the content under the sentence
# "first you need to write a text in cURL format"
# take that it is $HOME folder
curl -w "@ttfb.txt" -o /dev/null -s https://thecustomizewindows.com/license.txt

On OS X, omit all the n. They are not required for Apple’s UNIX. The last way is to use a bash script to somewhat automate cURL command set :

Webpagetest? It can be misleading because it is a heavy software than native cURL.

Tagged With windows 10 curl time for fisrt byte

This Article Has Been Shared 673 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Time To First Byte (TTFB) Demystified

  • Analysis of Cloud Computing Company : Rackspace

    Analysis of Cloud Computing Company is a continued topic and this is on the Worlds Largest Public Web Hosting Company The Rackspace Cloud.

  • Self Hosted WordPress on Cloud Server for Dummies

    Self Hosted WordPress is itself a scary phrase to a non-tech person and add Cloud Server on it. Here is Very Easy Guide to under Self Hosted WordPress.

  • SaaS : Everything You Wanted To Know

    SaaS or Software as a Service is designed by the architecture to be used by the consumer. SaaS is the model oCloud which the general users mostly know to exist.

  • How to Get Started with Cloud Server

    How to Get Started with Cloud Server – be it Rackspace or Amazon or any brand which basically delivers Cloud Server as IaaS so you can allocate RAM yourself.

  • Twitter Bootstrap Guide For Newbies

    Twitter Bootstrap guide is written in a way, so that the basic users can use Free Twitter Bootstrap Source Code and use customize for own website design.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What is Configuration Management February 5, 2023
  • What is ChatGPT? February 3, 2023
  • Zebronics Pixaplay 16 : Entry Level Movie Projector Review February 2, 2023
  • What is Voice User Interface (VUI) January 31, 2023
  • Proxy Server: Design Pattern in Programming January 30, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Time To First Byte (TTFB) Demystified," in The Customize Windows, August 21, 2014, February 6, 2023, https://thecustomizewindows.com/2014/08/time-first-byte-ttfb-demystified/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT