Deep Optimization Some Tips to Improve Website Access Speed_HTML/Xhtml_Web Page Production
- WBOYOriginal
- 2016-05-16 16:44:131307browse
Website access speed can directly affect website traffic, and website visits are almost directly linked to the website’s interests. Therefore, website speed has become a matter of great concern to enterprises and webmasters. Nowadays, there are more and more websites, and the opening speed of many friends’ websites is not ideal. Maybe you open the website very quickly, but others open your website but the speed is too slow. This may be caused by line problems such as China Netcom and Telecom, but mostly it is due to problems on our website itself that affect the speed. How to improve website access speed? Let’s talk about some key issues and solutions.
Many people use virtual hosts to build websites and store web page files in the virtual space. However, when there are too many page contents, the website opens very slowly. If you encounter this situation, instead of seeking a better solution Instead of using space, it is better to optimize the web page code to achieve satisfactory speed. The following summarizes some practical methods. When making a home page, the following methods can greatly improve the speed of the web page.
1. Remember to help the page lose weight
Browsing the web is actually downloading the web content in the virtual host to the local hard drive, and then using the browser to interpret and view it. The speed of downloading web pages accounts for a large proportion of the display speed. Therefore, the smaller the space occupied by the web page itself, the faster the browsing speed will be. This requires that you follow the principle of simplicity when making web pages, such as: do not use too large Flash animations, pictures and other resources. A clean, concise page will give people a sense of clarity.
2. If not necessary, try to use static HTML pages
As we all know, ASP, PHP, JSP and other programs realize the dynamic interaction of web page information. They are indeed very convenient to run because they have good data interactivity and can easily access and change the contents of the database, making the website "dynamic". ”, such as: forums, message boards, etc. However, this type of program must first be processed by the server, generate an HTML page, and then "send" it to the client for browsing, which has to consume a certain amount of server resources. If you use this type of program too much on a virtual host, the web page display speed will definitely be slow, so there is no need, please try to use static HTML pages.
3. Do not stuff the entire page content into a Table
This is a problem in web design. In order to pursue unified page alignment, many webmasters stuff the entire page content into a Table, and then use cell td to divide the layout of each "block" , the display speed of this kind of website is absolutely slow. Because the Table will not be displayed until all the content inside is loaded, if some content is inaccessible, it will delay the access speed of the entire page. The correct approach is: divide the content into several Tables with the same format, rather than stuffing them all into one Table.
4. Change access to ASP, ASPX, PHP and other files to .js references
This should be noted when designing programs such as ASP, ASPX and PHP. If you want to embed dynamic data in a static HTML page, and these dynamic data are provided by ASP, PHP and other programs, you will use the following Statement quote: In this case, every time someone visits your website, the server will execute and process the tongji.asp file, extract the corresponding data from the database, and then output it to the web page for display. If tens of thousands of people visit at the same time, It has to be executed tens of thousands of times, and the consequences can be imagined. It is recommended to dynamically generate data into a 1.js file in these programs, and then reference the js file through code such as on the homepage. In this way, the task of data display is left to the client's browser, which does not consume server resources, and the display speed is naturally very fast!
5. Use iframe to nest another page
For example, if you want to insert some advertising code on the homepage of the website, but do not want these advertising websites to affect the speed, then it is most appropriate to use iframe. For example, how to insert some advertising code on the homepage of http://www.aaa.com/: Put these advertising codes into a separate page, and then use the following code to embed the page on the homepage. However, this way the display of the entire homepage will not be delayed due to the delay of the advertising page. The code is as follows:
Where http://www.aaa.com/ServerPart.asp is the path of the referenced file.
6. Pay attention to the skills of website counter code placement
Placing counters in web pages can count website traffic and provide access basis for webmasters and advertisers. However, no matter how powerful the website statistics system is, there will always be failures. If you put the statistical code directly in front of the page content, or put it in a Table or div tag, then when the counter cannot be accessed, the Table or div on your page will cause a delay of tens of seconds, causing the page Takes a long time to access. Therefore, to improve the speed of the website, we must pay attention to the placement of the statistical code. The correct method is: put the statistical code at the bottom of the page, and do not place it in the same Table or div tag as the page content. You can place the statistics code directly at the bottom of the page code, or make a separate Table or div at the bottom to place the counter. In this way, your website speed will not be affected at all when the counter is inaccessible.
7. The knowledge of friendly links
Linking websites to each other can increase the publicity effect of the website. Linking LOGO pictures can more accurately describe the theme and positioning of the website, and the publicity effect will be greatly enhanced. However, too many picture links will inevitably affect the web page. display speed. Many webmasters like to directly quote the image URL on the friendship website, so that the image must be loaded first before it can be displayed. The access speed of each friendship website is different, and the entire table must wait for the image to be downloaded before it can be displayed, which greatly reduces the time consumption. Page speed. Therefore, when making friendly links, you should try to:
1. Only make text links: Making text links will not delay the speed of the web page.
2. Put all links into a separate page, and then link to the page on the homepage.
3. If the friendly link must appear on the homepage, please put the entire Table where the link is located at the bottom of the page. Because the page is displayed line by line from top to bottom, put it at the bottom of the page. Will delay the display of other content.
4. Download the LOGO image of the friendly link first and then transfer it to your own web space. In this way, the speed is determined by your own web space and is not affected by the friendly website.
8. Selection of website space
If the above methods are used and the space access speed is not ideal, then it may be a problem with your website space speed. When choosing a website space, it is recommended that you use a double-line space, which can avoid delays caused by network problems when other users access the website.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn