Let your webpage increase

xiaoxiao2021-03-06  20

Many friends use virtual hosts to do websites, store web files on virtual space, but the page content is more, the speed of the website is particularly slow, if you encounter this situation, it is better to seek better space, it is better The satisfaction speed is achieved by optimizing the web code. The author summarizes some practical methods to make homepage, the following methods can make your webpage speed increase.

First, remember to help the page to lose weight

We browse the webpage is actually downloaded the webpage content in the virtual host to the local hard drive, and then explain it with the browser. The quick slow slow to download the web page accounts for a lot of proportion, so the smaller the space occupied by the web page itself, the faster the browsing speed will. This requires the principle of simultaneously following everything, such as: Do not use too large Flash animation, picture, etc., put it out of the JavaScript code and CSS code in the page, put it in an independent and shared file, so this The file is only read once. When browsing other pages, IE will be read from the buffer, so that speed can be accelerated.

Second, if there is no need, try to use a static HTML page

As we all know, ASP, PHP, JSP and other programs have realized the dynamic interaction of web information, it is very convenient to run, because their data interactivity is good, it can easily access, change the content of the database, so that the website "move", Such as: Forum, Message Board, etc. However, such programs must be processed by the server, generate an HTML page, and then "send" to the client to browse, this has to consume a certain server resource. If you use such programs too much on a virtual host, web display speed will definitely slow, so there is no need to use a static HTML page as much as possible.

Third, don't put the entire page to a TABLE

This is the problem of web design. Many webmasters put the entire page in order to pursue the page uniform alignment, and then divide the layout of each "block" in the cell TD. The display speed of the website is absolutely slow. Because Table should wait for all the contents to be loaded, it is displayed after it is loaded. If some content cannot be accessed, the access speed of the entire page will be delayed. The correct approach is to split the content to several tables with the same pattern, don't all stuff it into a table.

4. Change access to files such as ASP, ASPX, PHP to. JS reference

This should be noted when designing program, ASPX, PHP and other program, if you want to embed dynamic data in a static HTML page, and these dynamic data is provided by ASP, PHP and other programs, the following statement Quote: