{"id":2000,"date":"2012-07-14T12:09:17","date_gmt":"2012-07-14T04:09:17","guid":{"rendered":"http:\/\/www.mudone.com\/?p=2000"},"modified":"2012-07-14T12:10:00","modified_gmt":"2012-07-14T04:10:00","slug":"capture-time-to-first-byte-using-curl","status":"publish","type":"post","link":"https:\/\/www.mudone.com\/?p=2000","title":{"rendered":"Capture Time To First Byte using curl"},"content":{"rendered":"<p>From: http:\/\/www.pinoytux.com\/linux\/capture-time-to-first-byte-using-curl<\/p>\n<blockquote><p>Working with websites is equivalent to non-ending website testing. Checking the speed of the site itself is not a new thing to check when doing performance diagnostics. And I found out that curl can calculate the speed of a website, from the initial connection time, to the time the first byte is downloaded, up to the total time the site has finished loading.<\/p>\n<p>Here is a sample command using curl:<\/p>\n<p>curl -o \/dev\/null -w &#8220;Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \\n&#8221; http:\/\/inserturl.here<\/p>\n<p>This command will output this:<\/p>\n<p>[root@rai01 ~]# curl -o \/dev\/null -w &#8220;Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \\n&#8221; http:\/\/pinoytux.com<br \/>\n% Total % Received % Xferd Average Speed Time Time Time Current<br \/>\nDload Upload Total Spent Left Speed<br \/>\n0 0 0 0 0 0 0 0 &#8211;:&#8211;:&#8211; 0:00:01 &#8211;:&#8211;:&#8211; 0<br \/>\nConnect: 0.268 TTFB: 1.528 Total time: 1.528<\/p>\n<p>Looks like my website is fast \ud83d\ude42<\/p>\n<p>The first data is the Connect time, which means this is how long it took for the curl to connect to the website.<br \/>\nConnect: 0.268<\/p>\n<p>The second data is time when the first byte was received, Time To First Byte (TTFB).<br \/>\nTTFB: 1.528<\/p>\n<p>The last data is the total time for the site to finish loading.<br \/>\nTotal time: 1.528<\/p>\n<p>You can also turn off the progress bar by adding the -s switch to the command.<\/p>\n<p>From: http:\/\/www.unquietdesperation.com\/2009\/03\/19\/time-to-first-byte-with-curl\/<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>From: http:\/\/www.pinoytux.com\/linux\/capture-time-to-fir [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[9],"tags":[],"class_list":["post-2000","post","type-post","status-publish","format-standard","hentry","category-technote"],"_links":{"self":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts\/2000","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2000"}],"version-history":[{"count":2,"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts\/2000\/revisions"}],"predecessor-version":[{"id":2002,"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts\/2000\/revisions\/2002"}],"wp:attachment":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}