Original article: http://lusongsong.com/reed/350.html
Even if the website is opened slowly, nine people may choose to leave. I have summarized about nine factors that affect the website opening speed, however, the speed of website page display depends on many factors, including server performance, network transmission quality, website bandwidth, DNS resolution, and webpage content, including the JSCode, The size of images and videos, and other factors. if not all of them exist, please follow the post to add them and correct them.
(For a good website, if it is slow to open, 9 of 10 will choose to leave)
1: Minimum network bandwidth
This is the most important factor. When a slow website is accessed at the same speed (that is, more money) with a good bandwidth, the network bandwidth includes two locations: the server bandwidth of the website and the client, the interconnection point refers to the connection between the egress end and the portal end (for example, China Telecom's connection to China Netcom), and the other refers to the minimum bandwidth of the user. If the user runs a K broadband, the user cannot help.
2: DNS resolution time
DNS resolution includes the number of round-trip DNS resolution times and the time it takes for each resolution. The product of the two is the time consumed by DNS resolution. Therefore, many people ignore the DNS problem. In fact, DNS is also very important for website resolution speed. For example, Google's recently launched page speed service and domestic dnspod provide DNS acceleration for domain names for free. You can try it.
3: machine configuration
In the same network environment, dual-core servers certainly have stronger computing power, including the hardware configuration of servers and clients. Undoubtedly, in the same network environment, you can use a race Yang machine and a four-core processor computer to open the same webpage. The speed is certainly not the same.
4: Server Software
The number of software, stability, and correct software configuration will affect the server environment and network speed. The installation of a software firewall on the server sacrifices some network speed. Therefore, the installation of a firewall on the VPs or an independent server is sufficient.
5: webpage content size (important)
The size of webpage files is one of the most important factors for a website to be quickly opened. If we cannot decide the server or other hardware aspects, we strongly recommend that you start from here, whether it is a table or Div + CSS, proper code optimization can reduce the page size.
Optimize the code as much as possible and use the least amount of code. For example, after Lu songsong simplified the blog template a few days ago, each webpage reduced by more than 100 k, improving the website opening speed, do not include the entire content in a box. In the article "weight your website and speed up your website", I will introduce in detail how to optimize the webpage code. At the same time, a large number of errors and redundant code are also one of the slow website speeds.
6. A large number of database operations
When a small website performs a large number of database operations, it will also affect the website opening speed. Here, the ASP + access structure of the website is particularly obvious, especially when a large number of users submit comments at the same time, the operation database is locked, and the website cannot be opened. For example, my blog is being published.ArticleIt may take several minutes to speed up your website.
7: use a lot of JavaScript
Using a large number of JS on the website is a big taboo. Not only can the search engine be indexed, but also requests will be submitted continuously to increase the burden on the server, such as mouse effects, column special effects, and status bar special effects. These special effects are first downloaded from the server to your local machine and then run and generated on your local machine before you can see them. After the special effects are done more, it takes more than half a day to complete the operation on your local machine. If your host configuration is normal, it will be slower. Therefore, we recommend that you use less JavaScript special effects.
8: large images and flash on the page
We know that images are the most important factor to slow down the network speed. After processing images, the image space can be reduced. The pictures in each blog post of Lu songsong are processed, however, some images are not clear enough. Otherwise, many images will occupy a lot of space at the beginning, making the website open slowly. Flash is also a truth.
9: too many references from other websites
This includes referencing images and video files from other websites. If you reference other websites directly on the page, and the website is slow, or the website does not exist, then you can open it very slowly.
10. Whether the user and the server are in the same region.
The response time for users in Mainland China to access the U.S. server, Hong Kong server, and mainland China server is as follows:
U.S. servers: average> 5 S
Hong Kong servers: 1 ~ 2 S
Mainland China: within 1 s