{"id":848,"date":"2021-02-02T11:21:50","date_gmt":"2021-02-02T11:21:50","guid":{"rendered":"https:\/\/neoxea.com\/blog\/?p=848"},"modified":"2024-09-12T11:50:36","modified_gmt":"2024-09-12T10:50:36","slug":"website-speed-time-to-first-byte","status":"publish","type":"post","link":"https:\/\/neoxea.com\/blog\/website-speed-time-to-first-byte\/","title":{"rendered":"Website Speed: Time to First Byte (TTFB)"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\" id=\"h-website-speed\">Website Speed<\/h3>\n\n\n\n<p>When troubleshooting a slow website, there are a few helpful metrics to determine the causes and solutions. One of those metrics is the Time To First Byte (TTFB), a measurement used by all website performance benchmarking tools. It\u2019s an important metric to measure how fast your website starts loading in a specific location or with a particular combination of settings. Understanding TTFB can help you better grasp how website speed works, what\u2019s slowing down your website, and how to fix it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-is-time-to-first-byte-ttfb\">What is Time To First Byte (TTFB)?<\/h3>\n\n\n\n<p>TTFB measures the time elapsed between the time a web user makes an HTTP request, like loading a web page, to when the client\u2019s browser receives the first byte. Many use this reading as a rudimentary way to test server speed, and while this works, it\u2019s only half the story. If the website you\u2019re trying to load uses a&nbsp;Content Management System (CMS)&nbsp;like WordPress, the server must do all the CMS computations required to produce content. The PHP service must load your MySQL database, get the content, calculate the appropriate HTML output, and return it to the website visitor.<\/p>\n\n\n\n<p>If you have a slow CMS, all those steps can take time, and you may receive lousy TTFB results like 1-3 seconds or more (a good online tool to check your TTFB performance is <a href=\"https:\/\/gtmetrix.com\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">GTmetrix<\/a>). That doesn\u2019t necessarily mean your hosting server is slow or experiencing issues, but good chances are they are not using <a href=\"https:\/\/neoxea.com\/blog\/ssd-storage\/\">SSD storage<\/a> or <a href=\"https:\/\/neoxea.com\/blog\/what-is-litespeed\/\">Litespeed<\/a>. More often than not, it means you have too many plugins or extensions, you\u2019re not using a caching system, or you\u2019re using an old PHP version. Of course, it is a different story if you are measuring a static HTML page with a slow TTFB. Then, you may want to start your investigation from the server itself, as no other factors impact your website&#8217;s performance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-does-dynamic-caching-affect-ttfb\">How Does Dynamic Caching Affect TTFB?<\/h3>\n\n\n\n<p>Dynamic Caching is like having your local barista remember your order instead of having to repeat it every time. Because they already know your drink, they can start making it as soon as you walk in, serving it to you that much faster. Caching works in a similar way by storing the data required to serve a webpage for next time.<\/p>\n\n\n\n<p>Our&nbsp;Dynamic Caching&nbsp;uses NGINX as a reverse proxy. That means that all the computing from your PHP and MySQL services are stored in the server\u2019s RAM. When a visitor gets a cached response from us, it\u2019s like they\u2019re loading a static HTML page \u2014 only faster! It\u2019s faster because the content is served from memory and not from the server\u2019s hard drive. Although SSDs are super fast, nothing compares to the server RAM when it comes to speed.<\/p>\n\n\n\n<p>If you have the Dynamic Caching on and still have slow Time to First B, there are two things to check:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Are you measuring a cached result? The easiest way to check is to perform your test more than once. It is normal to get a slower first result and much faster consecutive ones. By performing multiple tests you can guarantee you\u2019re measuring cached results.<\/li>\n\n\n\n<li>Are you measuring from a close geographical location? If you\u2019re testing from a remote location, it is normal that you have high networking latency. If you want your website to be fast from a variety&nbsp;of locations, consider implementing a CDN.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-can-all-pages-be-cached\">Can All Pages be Cached?<\/h3>\n\n\n\n<p>Not all pages can be fully cached. Checkout pages, carts, and logged-in users have exceptional circumstances. That doesn\u2019t mean the TTFB has to be slow. The first step is making sure you\u2019re using PHP 7.1 or above. We have opcache enabled by default for it, and WordPress and other CMS apps work dramatically faster. Next, you can use our Memcached service to improve your app\u2019s time to get data from the MySQL server. Last but not least, check the plugins you\u2019re using. How many are you using, are they high-quality, and what load do they cause to your page rendering process?<\/p>\n\n\n\n<p>Caching tends to camouflage poorly built websites by masking development problems. If your website loads quickly without cache, this means it has good code and is \u201chealthy\u201d. It would help if you didn\u2019t rely solely on our Dynamic Caching or your own caching plugins to have a fast website.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-does-a-content-delivery-network-cdn-affect-performance\">How Does a Content Delivery Network (CDN) Affect performance?<\/h3>\n\n\n\n<p>As mentioned above, TTFB is seriously affected by the networking speed between the server and your browser (or the tool you\u2019re using to test your speed). Using a CDN can improve your website speed if it has endpoints near your geographic location. Note, however, that if you have a CDN like&nbsp;Cloudflare or QUIC enabled, you\u2019re measuring the TTFB between your browser and the particular CDN endpoint serving your request and not between you and the neoxea server. If the CDN hasn\u2019t cached your content yet, it has to call the neoxea server first, get the data, distribute it and then serve it to you. That may cause further delay before the first byte is received.<\/p>\n\n\n\n<p>To get around this, make sure you have caching enabled for your CDN and check whether it has an endpoint close to your geographic target. It\u2019s worth experimenting with different CDN providers if your visitors are in a part of the world that your current one does not cover.<\/p>\n\n\n<style>.kb-row-layout-id1958_9b7b8d-00 > .kt-row-column-wrap{align-content:start;}:where(.kb-row-layout-id1958_9b7b8d-00 > .kt-row-column-wrap) > .wp-block-kadence-column{justify-content:start;}.kb-row-layout-id1958_9b7b8d-00 > .kt-row-column-wrap{column-gap:var(--global-kb-gap-md, 2rem);row-gap:var(--global-kb-gap-none, 0rem );padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);grid-template-columns:minmax(0, 1fr);}.kb-row-layout-id1958_9b7b8d-00 > .kt-row-layout-overlay{opacity:0.30;}@media all and (max-width: 1024px){.kb-row-layout-id1958_9b7b8d-00 > .kt-row-column-wrap{grid-template-columns:minmax(0, 1fr);}}@media all and (max-width: 767px){.kb-row-layout-id1958_9b7b8d-00 > .kt-row-column-wrap{grid-template-columns:minmax(0, 1fr);}}<\/style><div class=\"kb-row-layout-wrap kb-row-layout-id1958_9b7b8d-00 alignnone wp-block-kadence-rowlayout\"><div class=\"kt-row-column-wrap kt-has-1-columns kt-row-layout-equal kt-tab-layout-inherit kt-mobile-layout-row kt-row-valign-top\">\n<style>.kadence-column1958_62eb2d-49 > .kt-inside-inner-col,.kadence-column1958_62eb2d-49 > .kt-inside-inner-col:before{border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;}.kadence-column1958_62eb2d-49 > .kt-inside-inner-col{column-gap:var(--global-kb-gap-sm, 1rem);}.kadence-column1958_62eb2d-49 > .kt-inside-inner-col{flex-direction:column;}.kadence-column1958_62eb2d-49 > .kt-inside-inner-col > .aligncenter{width:100%;}.kadence-column1958_62eb2d-49 > .kt-inside-inner-col:before{opacity:0.3;}.kadence-column1958_62eb2d-49{position:relative;}@media all and (max-width: 1024px){.kadence-column1958_62eb2d-49 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}@media all and (max-width: 767px){.kadence-column1958_62eb2d-49 > .kt-inside-inner-col{flex-direction:column;justify-content:center;}}<\/style>\n<div class=\"wp-block-kadence-column kadence-column1958_62eb2d-49\"><div class=\"kt-inside-inner-col\"><style>.wp-block-kadence-spacer.kt-block-spacer-1958_649432-7f .kt-block-spacer{height:60px;}.wp-block-kadence-spacer.kt-block-spacer-1958_649432-7f .kt-divider{border-top-width:5px;height:1px;border-top-color:#3293e3;width:10%;border-top-style:solid;}<\/style>\n<div class=\"wp-block-kadence-spacer aligncenter kt-block-spacer-1958_649432-7f\"><div class=\"kt-block-spacer kt-block-spacer-halign-left\"><hr class=\"kt-divider\"\/><\/div><\/div>\n\n\n\n<p>Save time and money, plus make your website go faster with our next-generation cloud platform available in every Managed WordPress plan. This includes a high-performance web server, DDoS protection, malware and email spam mitigation, a free cache plugin, and the world&#8217;s fastest AMD CPU machines. Get started with no long-term contracts, free migrations, and a 30-day money-back guarantee.<br>Check out our <a href=\"https:\/\/neoxea.com\/pricing\/\">plans<\/a> or talk to <a href=\"https:\/\/neoxea.com\/contact-us\/\">sales<\/a> to find the right plan for you.<\/p>\n<\/div><\/div>\n\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Website Speed When troubleshooting a slow website, there are a few helpful metrics to determine the causes and solutions. One of those metrics is the Time To First Byte (TTFB), a measurement used by all website performance benchmarking tools. It\u2019s an important metric to measure how fast your website starts loading in a specific location&#8230;<\/p>\n","protected":false},"author":1,"featured_media":850,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[3,27],"tags":[],"class_list":["post-848","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-seo","category-wordpress"],"taxonomy_info":{"category":[{"value":3,"label":"SEO"},{"value":27,"label":"WordPress"}]},"featured_image_src_large":["https:\/\/neoxea.com\/blog\/wp-content\/uploads\/2021\/08\/timetofirstbyte300.png",300,300,false],"author_info":{"display_name":"Rodolfo","author_link":"https:\/\/neoxea.com\/blog\/author\/blogxea\/"},"comment_info":0,"category_info":[{"term_id":3,"name":"SEO","slug":"seo","term_group":0,"term_taxonomy_id":3,"taxonomy":"category","description":"","parent":0,"count":3,"filter":"raw","cat_ID":3,"category_count":3,"category_description":"","cat_name":"SEO","category_nicename":"seo","category_parent":0},{"term_id":27,"name":"WordPress","slug":"wordpress","term_group":0,"term_taxonomy_id":27,"taxonomy":"category","description":"","parent":0,"count":13,"filter":"raw","cat_ID":27,"category_count":13,"category_description":"","cat_name":"WordPress","category_nicename":"wordpress","category_parent":0}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/neoxea.com\/blog\/wp-json\/wp\/v2\/posts\/848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/neoxea.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/neoxea.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/neoxea.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/neoxea.com\/blog\/wp-json\/wp\/v2\/comments?post=848"}],"version-history":[{"count":1,"href":"https:\/\/neoxea.com\/blog\/wp-json\/wp\/v2\/posts\/848\/revisions"}],"predecessor-version":[{"id":2690,"href":"https:\/\/neoxea.com\/blog\/wp-json\/wp\/v2\/posts\/848\/revisions\/2690"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/neoxea.com\/blog\/wp-json\/wp\/v2\/media\/850"}],"wp:attachment":[{"href":"https:\/\/neoxea.com\/blog\/wp-json\/wp\/v2\/media?parent=848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/neoxea.com\/blog\/wp-json\/wp\/v2\/categories?post=848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/neoxea.com\/blog\/wp-json\/wp\/v2\/tags?post=848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}