If a website opens extremely slowly, how many seconds will you endure? 秒，再多一秒就会选择把这个网页关闭。 According to a survey of colleagues around, Xiaobian found that ordinary people's expectations for the speed of opening a web page are "seconds open", which can tolerate up to 5 seconds, and will choose to close the web page for another second. If our website opens slowly, it will basically be abandoned by users. With so many similar websites, anyone will want to experience a good website. 还重要，而想解决这个问题比SEO也简单的多。 For a website, the speed of opening a website is even more important than SEO, and it is much simpler to solve this problem than SEO . There are probably four reasons for the slow opening of the website. The editors provide solutions one by one.
First, too much pursuit of website display effects, pictures or special effects cause the website to open slowly
In order to pursue gorgeous display effects, some websites now have large pictures and special effects, and the pages are gorgeous, but these picture special effects need to be downloaded to the local area to display, which is simply a disaster for users with insufficient broadband bandwidth. In fact, due to the limitation of the display resolution, the bigger the picture is, the better. Compressing the space occupied by the picture as much as possible while ensuring sufficient use can significantly speed up the web page and reduce the load on the server. Minimize the use of flash on the website, which is not conducive to the speed of opening the website. It is also not conducive to later optimization.
In addition, there are some special effects written by some JS code. These codes are not complicated, but they also consume a lot of server resources and have an impact on the speed of the website. This requires the webmaster to weigh the pros and cons.
Website coding and programming are not concise
等，需要通过Unicode编码才能相互转换。 First of all, the encoding used in website construction . At present, commonly used encodings are UTF-8, GBK, etc., which need to be converted to each other through Unicode encoding. 可以节省空间。 If your website has a lot of English characters, using UTF-8 can save space. 或者GB2312编码。 Otherwise, try to use GBK or GB2312 encoding. It can also reduce website load times. 。 The website programming code should be more standardized, concise, and minimize the amount of waste code. The ideal layout should be DIV + CSS .
Third, the virus in the website server
A virus in the web server is also an important reason for the slow loading of the web site. In recent years, the network security situation is worrying. Some viruses use hidden code to embed executable text files. When users browse the webpage, the Trojan starts mining automatically, which takes up a lot of computer resources and slows down the website. However, there are no very effective preventive measures in this regard, and some vulnerabilities may be newly discovered. We should try our best to back up the data regularly and securely, and then restore it through backup files in time. In addition, the virus in the website must not only remove the virus after the Trojan, but also need to check the weak link of server security settings to strengthen this aspect.
Fourth, the compression format of the website is not suitable
、 Javas cript在运行前都压缩成一行，减小页面体积增加访问速度的同时，搜索引擎也更喜欢，对网站收录有正面的影响。 The loading speed of the website is actually related to the compression format. We can completely compress HTML, css , and Javas cript into a single line before running. While reducing the page size and increasing the access speed, search engines also prefer it. Impact.
In addition to the above four main reasons, the speed of website opening is also affected by other factors such as server selection, database selection, etc. These aspects are easy to find and solve, and I will not repeat them one by one. Website opening speed is an important indicator of website experience. Website operators must monitor in real time, and problems must be resolved in time.