问题原文
原帖链接 · MeltingDog · CC BY-SA 3.0
I have a website the seems to load very slowly. When I run a speed test on it I see there seems to be a 6 secound gap before the HTML loads. Images and JS scripts load very fast after that point.
You can see in the pic below the yellow 'wait time' bars:
This seems to be consistant no matter what the HTML content on the page is.
This site is using a CMS (ModX Revo) so HTML is actually stored in an SQL database and brought forth by PHP, but I've never experienced this issue before.
Would anyone know what is causing this and how I could speed it up?
已采纳解答
原帖链接 · Simon Hayter · CC BY-SA 3.0
The technical term for waiting is refereed to as time to first byte and determines the responsiveness of a web server or other network resources.
Some common reasons you might see an high time to first byte:
- Overloaded network (normally shared hosting)
- Misconfiguration servers
- Distance from you and the server (geo location plays a minor role)
- Server errors (hops)
Generally this problem is often seen in shared hosting because of the sheer amount of websites and people visiting them which of course increases the network byte time. Another possible cause is an error on the network somewhere, like a hop or because your server is not within the location of your targeted audience, for example a 'GOOD' UK server will have a lower byte time than a US server targeting users in the UK, because of the distance that the data needs to be sent and received (Normally a increase of around 100-200ms).
Maybe a time to get a new host
In the past I have to move from server to server because of the lag of the time to first byte, you may be in the situation of having to choose a new web host or upgrade your current package.
Reliable testing
Testing the speed of your website from your home broadband is very biased because it may be a problem with your broadband not responding to the website. You should test your website using multiple connections from multiple servers... I recommend web page test and running multiple tests at once from different locations and many in the targeted geo audience. This will give you a better overview of whats going on, if its first byte then I recommend you contact your web host before anything else.
Pinging and trace route the server
If you attempt to run a ping on the server the results may display or may not, ping uses ICMP rather than UDP or TCP meaning its not like querying the server on port 80 which your httpd will be running on. You could use trace route to identify any servers on the route that could be causing the first byte to increase, again... it does not query the httpd server on port 80 and if traceroute using Windows it'll use ICMP and Mac/Linux machines will use UDP. It's worth testing because its such a quick and easy thing to do but if the results come back fine, doesn't necessary mean there isn't a problem somewhere.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
