7 recipes to improve speed of web site opening

Source: Internet
Author: User
Tags html page net php and reference client access
Speed a lot of friends use a virtual host to do the site, the Web page files stored in the virtual space, but the page content of a lot, the speed of the site is very slow to open, if you encounter this situation, rather than seek better space, as well as by optimizing the code to achieve satisfactory speed. The author summarizes some practical methods, the following methods can make your Web page speed greatly improved when making the homepage.

   First, remember to help the page to lose weight

We browse the Web to actually download the contents of the Web page from the virtual host to the local hard drive, and then explain the view in the browser. Download the speed of the page in the display rate accounted for a large proportion, so the page itself occupies a smaller space, then the faster browsing speed. This requires that when you do the Web page to follow the principles of basics, such as: Do not use too large flash animation, pictures and other resources. A clean, concise page gives a sense of clarity.

   Second, if not necessary, try to use static HTML page

As we all know, ASP, PHP, JSP and other programs to achieve the Dynamic Web page information interaction, it is really very convenient to run, because their data interaction is good, can easily access, change the content of the database, so that the site "move" up, such as: Forum, message board and so on. However, this kind of program must first be processed by the server, generate HTML page, and then "send" to the client browsing, this will have to consume a certain amount of server resources. If you use this type of program on a virtual host too much, the page display speed will be slow, so there is no need, please try to use static HTML page.

  Third, do not plug the entire page content into a table

This is the problem of web design, a lot of webmaster in order to pursue the page unified alignment, the entire content of the page into a table (table), and then by the cell TD to divide the layout of each "block", the display speed of this site is absolutely slow. Because the table to wait for all the contents are loaded after the display, if some content is inaccessible, it will delay the entire page access speed. The right thing to do is to split the content into a few table with the same pattern, not all in a table.

   Four, the ASP, ASPX, PHP and other file access to. JS Reference

This is in ASP, ASPX, PHP and other programming should pay attention to, if you want to embed dynamic data in the static HTML page, and these dynamic data is provided by ASP, PHP and other programs, will use the following statement reference: So, every time a person visit your site, The server will execute and process a tongji.asp file, extract the corresponding data from the database, and then output to the Web page display, if tens of thousands of people visit at the same time, it is necessary to perform tens of thousands of times, the consequences can be imagined. It is recommended that the data be dynamically generated into a 1.js file in these programs, and then http://www on the home page via < SCRIPT src= ". Xxx.com/1.js"></script> code like this to reference the 1.js file. In this way, the task of data display to the client's browser to do, will not consume the resources of the server, the display speed naturally quickly; The author's website www.25cn.net under a index3.htm file, you can visit www.25cn.net /index3.htm and www.25cn.net do a comparison, the former time spent is almost the latter several times!

   Use an IFRAME to nest another page

If you want to insert some advertising code on the site, and do not want to let these advertising sites affect the speed, then the use of IFRAME is the most appropriate. The method is: Put the advertising code to a separate page, and then in the first page with the following code to embed the page, so that will not because the delay of the advertising page dragged the entire home page display, the code is as follows:

< IFRAME marginwidth=0 marginheight=0 src= "http://www.webjx.com/index.html" frameborder=0 width=468 Scrolling=no height=60 leftmargin= "0" topmargin= "0" ></iframe>

Where http://www.webjx.com/index.html is the path of the referenced file.

   Six, pay attention to the site counter code placement skills

In the Web page to place counters can be statistical site traffic, for webmasters and advertisers to provide access to the basis, but no matter how powerful the function of the site statistics system, there will be a failure. If you put the statistic code directly in front of the page, or in a table or div tag, then when the counter is inaccessible, the table or div on your page will have a delay of 10 seconds, causing the page to be accessed for a long time. So, to improve the speed of the website, we must pay attention to the location of the statistics code placement, the correct way is: Put the statistics code to the bottom of the page, and not with the content of the page in a table or div tag. You can place the statistic code directly at the bottom of the page code, or make a table or div to place the counter separately. In this way, the speed of your website will not be affected when the counter is inaccessible.

   The knowledge of Friendship link

Links between the site can increase the publicity of the site, do logo picture links More accurate description of the theme of the site and positioning, publicity will be greatly enhanced, but the picture links do too much, will inevitably affect the speed of the page display. A lot of webmaster like to directly quote the picture URL on the friendship website, so that the picture must be loaded before it can be displayed, the access speed of each friendship site is different, the entire form must wait for the picture to be displayed, so that the speed of the page is greatly reduced. Therefore, do the friendship link should try to do:

1. Only text links: Do text links will not delay the speed of the Web page.

2. Put all the links on a separate page and then link to the page on the homepage.

3. If the link must appear on the first page, please put the entire table of the link to the bottom of the page, because the page is displayed from top to bottom line by row, put it to the bottom of the page, will not delay the display of other content.

4. The logo image of the link to download and then upload to their own web space, so that the speed by their own web site space decisions and not affected by the friendship site.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.