Why does this webpage load very slowly when I first open it? It takes a few seconds to open. I see that the html file takes more than 3 seconds to load. Why is this? Was it tested on the company's server?
Why does this webpage load very slowly when I first open it? It takes a few seconds to open. I see that the html file takes more than 3 seconds to load. Why is this? Was it tested on the company's server?
From the screenshot, your problem is mainly focused on the slow return of html text, the green line is very long, and green means Waiting (TTFB)
About what TTFB is, you can read this article https://scaleyourcode.com/blo...
To put it simply, the time it takes for your server to return html data to you is basically the same as the green time. Then your question is to find out why the html return is very slow. The basic reason is that it is slow to check the data. Or it’s the internet aunt
brand.html
This is the brand page. Judging from the size of the page 9k
, your page rendering work should be completed by the server and returned, which poses the risk of network congestion.
I don’t know how you wrote the code. There are only two reasons for the slow response of the server:
Your program has too many database reads or synchronization operations, and there is a problem of response waiting (program)
Your test server network or performance is poor (hardware)
It is recommended that you reduce server-side synchronization operations, and try to divide the page into modules and use a client-side rendering solution (using JS asynchronous rendering) on the premise of meeting the prescribed SEO requirements
Or the server only renders the first screen data, and the subsequent data is lazy loaded and rendered using JS
The test server may be slow
Handsome guy, you have so many pictures, I recommend using CSS sprite
Look at what’s in that html?
This problem is also related to the tcp/ip protocol. The first time you visit a website, a three-way handshake will be performed, which is very time-consuming. But once the connection is established, it goes very quickly. Because there is no need to shake hands. So the first visit will be a little slower.
I have encountered the same problem. The server system was very fast before reinstallation, but slowed down after reinstallation.
This eliminates the bandwidth problem. The pages visited are the same, and gzip transmission is enabled. .The transferred data size is the same.
But it takes several seconds to transfer a file less than 10K, I can’t figure it out.
Later I found that the hosts file was blank, and then I put
<code>127.0.0.1 localhost</code>
After joining the hosts, the speed returned to normal
The TTFB time is too long. It is a problem on the server side. Try optimizing it from the server side.
First make sure the network is stable