I have just moved web hosts and at the same time created a new Wordpress website
I have tried to optimise it as much as possible in terms of loading speed, and it now performs well in tests like GTMetrix
However, whenever I visit the site myself (in Firefox) It seems to hand for about 5 seconds before the page even starts to load. At the top of the tab Firefox shows “Connecting…” and in the bottom status bar it shows “waiting for www.domain-name-here.com”
If I try Chrome, the result is the same, although not quite as bad (maybe 2 or 3 seconds of hang before the page loads)
As soon as it “finds” my website it loads lightening fast (a couple of seconds) but its this initial hang of 5 seconds or so which I want to try and get to the bottom of.
It’s as if the domain name is difficult to resolve somehow. I do use Cloudflare in a bid to try and speed it up further, but perhaps this could be at fault?
Anything else I can try, or tools I can use to work out where the lag is originating from would be most helpful
It could be a DNS resolution issue. I have my DNS with my domain registrar. One day it was taking a long time for the DNS to return a result–over 20 seconds. Usually that does not happen. But it can happen. It could also be a function of how far away you are from your web server.
You mention GTMetrix. Do they provide DNS response times with their test? tools.pingdom.com does. Look at the DNS times and also the “wait time” for your main index page. That will be the amount of time it takes for your server to generate the content. If you have a caching plugin, that is not going to skew your result. So don’t have a caching plugin running when you test.
Run a test with tools.pingdom.com and you will find what is taking the time.
Which to me looks OK, but that doesn’t reflect what it’s like to actually browse to the site myself. 5 seconds after doing this test I browsed to my site, and it took almost 10 seconds to even begin loading the page. Strange.
Oh, and I am on a Heart Internet reseller account, which I believe is still shared hosting.
That is an acceptable time. However, keep testing. Your DNS is fine and now your wait time is fine. But it sounds like there is an issue that comes and goes. It could be a lot of things such as a server load spike or problems with your ISP or DNS. You will not find the problem if you don’t get a test result when you are having the problem.
Just this morning I had problems with my ISP. Every website I tried to access either loaded very slowly or timed out. Check your server load. Try sticking this in a PHP file and then running the file by navigating to the page with your browser:
<?php
print_r(sys_getloadavg());
?>
Report back the findings. (If it does not work on your system, there are other methods to try.)
If you’re using windows on your normal computer, fire up command prompt and type in:
tracert your_site
whenre “your_site” is the address for your site. It’ll show you up to 30 places any data passes between your computer and a given site has to pass through and how long it takes for that step of the journey between the site and your computer.
If you’ve just changed hosts, it might be taking a while for any DNS changes to propergate around the various ISPs
Mainly WordPress site depends on the number of plugin installed and quality of theme currently active… First disable all plugin one by one and check the speed if there is major change speed while disabling any plugin remove it and install an alternate for that plugin…