Improve First byte time - Wordpress -

Hi -

we have a website is is apparentlly not that big… but the first byte time is really huge sometimes…

It’s a wordpress website and hosted on
Here is one of the tests we ran.

anything we can do to optimize it?


Not really. You say the TTFB “is really huge sometimes”. That’s because you’re sharing a server with hundreds, if not thousands of other websites. During peak hours, or when other sites suddenly surge in traffic, the performance of your website will suffer. Unfortunately, that’s the reality of shared hosting environments. Some hosts are better than others, but it’s hard to tell upfront.

What you can do is make sure your Wordpress installation is as light as possible, by disabling unnecessary plug-ins, for example.

Note that your TTFB is doubled by the slow redirect from to (which again suggests that your host’s server is under heavy load). If you run a test without the ‘www’ your results will probably be a little less intimidating.

What I think is happening is this, you go to the site and then apache/php (starts) loads/compiles the site. The .htaccess is read and a re-direct is applied (or did you redirect from within wordpres?. I don’t know/use wordpress or possible plugins. If it is in wordpress, you could also use parts of the info below.)

Then the browser does a new DNS lookup for and apache loads the website again (compiling)

Depending on how much control you have over the server/site you could seperate and to different folders, where is empty / no wordpress and in the .htaccess you specify redirect permanent / This would prevent PHP compiling all PHP pages.

This is something I did not test, it’s theoretical. This only affects users that use the URL but at least it should cut the time in half.

From what I have seen is that the page is ok when it’s initially loaded due to some caching. The main thing to speed-up would be to check if the hoster can setup something like Opcache or xcache or Zend-optimizer.

This keeps the PHP pages compiled instead of compiling each page upon request. This does not effect the output of the page, it’s mererly that the php code is compiled into server readable language for processing. When you update a php file, it will be newly compiled / cached with programs like Opcache / xcache etc.

@Bas-tester. Not really.

The 301 redirect to - if performed in .htaccess ( or httpd.conf ) is done before any handover to php happens. However, if it’s internal to PHP, then your theory is true.

Getting the optimum website performance is never a single tweak, but if you’re on a shared server, then the complexity of the shared sites and the greed of the service provider are your limiting factors. If site performance is important to you, then running on a decent VPS provider ( linode is my favourite - no I’m not affiliated! ) is an imperative first step… then you have the ability to tune web server, database, server side language resources, and so on. Caching is a big part of this too…