Reduce TTFB Magento

Magento – How To Reduce Time To First Byte (TTFB)

Slow page load speeds are a common problem with Magento stores. The goal is to have your page load in under two seconds, and after preforming a speed test, you will find that often your Time To First Byte (TTFB) will be over two seconds itself!

Many guides will tell you to optimize your images, deploy a full page cache, minify your CSS & JavaScript, or to reduce the number of requests your website makes (I’ll touch on these some more in another post). While these are great ways to reduce your overall page load speed, they will rarely make a noticeable difference in your TTFB. Fortunately (or unfortunately), there is only one thing you need to reduce your TTFB.

$$$

TTFB is most affected by your web hosting service, and like most things, if you want quality you will have to pay for it. Magento is a heavy piece of software, and has to process many PHP & other template files before rendering out your finished webpage. It is this processing time that makes up your TTFB. If your server is slow (or busy on a shared host) it will take longer to render the HTML of your page, forcing every other element (images for example) to wait to load, creating an excruciatingly slow page load, especially on category pages.

Case Study: Developing a Magento site with over 10,000 products originally hosted on a shared hosting plan from a company that is a Magento Platinum Partner.

No matter how much optimization we performed (all of the techniques listed above and more) we could not get the TTFB under 2.5 seconds, with the overall page load time coming in around 5 seconds (despite assurances from the hosting provider that their servers were fast enough). Obviously this is not acceptable for e-commerce, so before launch we switched to a new host with a dedicated server using solid state hard drives (SSD). The difference was night and day. Without doing any other optimizations our time to first byte was reduced to 0.4 seconds, and our overall page load to 2.5 seconds. Our cost however, went up from $50/month to $200/month.

Once you have a decent hosting package in place, then you can focus on other ways to improve your site speed. Other factors that may reduce your TTFB include limiting the amount of extensions you are using, uninstalling unused extensions, and making sure no extensions are conflicting or causing a slow page load. Simply run a website speed test, then deactivate an extension, run the speed test again and see if there is a noticeable reduction in page load. Some hosts will offer code profiling services to help you find out if any pages or extensions are causing loading problems.

How much should I spend on hosting?
Forget about running Magento on an $8/month shared hosting plan. To run Magento successfully I recommend a dedicated server with at least 4gb of RAM that uses solid state drives. Depending on the size of your store, you should expect to be in the ballpark of $100/month in hosting, however it could quickly go up from there.

Who do I recommend?
I have found great success using Mage Mojo Magento Hosting. To be clear I am in no way affiliated with MageMojo, and receive no commission or benefit for recommending their service. What makes them unique is that they only host magento stores, a very fast support response time, and their own custom made Control Panel for Magento. Their cheapest plan starts at $60/month.

I hope this post has given you some insight into improving your TTFB. If you need some help speeding up your store or website, please don’t hesitate to contact me.

-Rob