Why does it take more than three seconds to load html files when the webpage is opened? Tested on a company server?
Why does it take more than three seconds to load html files when the webpage is opened? Tested on a company server?
Reply content:
Why does it take more than three seconds to load html files when the webpage is opened? Tested on a company server?
From the above, your problem is mainly due to the slow response of html text, the long green line, and the long green line indicating Waiting (TTFB)
About what TTFB you can read this article https://scaleyourcode.com/blo...
In layman's terms, that is, the time when your service end returns html data to you, which is basically the same as the green time. your problem is to check why the html response is slow, the basic reason is that data query is slow. Or the Internet aunt
brand.html
This is the brand page, from the page size9k
We can see that your page rendering work should be returned by the server end, which poses a risk of network congestion.
I don't know how you write the code. There are two causes of slow server response:
There are too many read or synchronization operations in your program database, and there is a problem of waiting for response (program)
Your testing server network or performance is not powerful (hardware)
We recommend that you reduce the number of synchronization operations on the server. to meet the SEO requirements, try to use the client rendering scheme for page modules (using JS asynchronous rendering)
Or the server only renders the data on the first screen, and the subsequent data is loaded and rendered in JavaScript lazy mode.
The test server may be slow.
Handsome guy, you have so many images. CSS sprite is recommended.
Let's see what's in that html?
This issue is also related to the TCP/IP protocol. The first visit to the website will carry out three handshakes, which is very time-consuming. However, after the connection is established, it will soon become possible. Because there is no need to shake hands. Therefore, the first access will be slower.
I have encountered the same problem. The speed of server system reinstallation is fast, and the speed is slow after reinstallation.
This eliminates the bandwidth issue. The accessed pages are the same, and gzip transfer is enabled. the transmitted data size is the same.
However, it takes several seconds to transmit a file of less than 10 kB.
Later, I found that the hosts file is blank, and then I
127.0.0.1 localhost
After being added to the hosts, the speed returns to normal
TTFB is too long. it is a problem on the server side. try to optimize it on the server side.
First, make sure that the network is stable.