A practical way to improve Web page opening speed

Source: Internet
Author: User

  website Access speed can directly affect the traffic of the site, and the site's access to almost directly linked to the interests of the site, so the speed of the site becomes the enterprise and the webmaster is very concerned about the problem. now the site more and more, many friends of the website open speed is not ideal. Maybe you open the website quickly, others open their website but reflect the speed is full. This may be because of netcom and telecommunications and other problems caused by the line, but most of them because of the problem of the site itself affected the speed. How to improve the speed of website access ? Let's talk about some of the key issues and workarounds.

Many people 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, if you encounter this situation, and seek better space, than by optimizing the page code to achieve satisfactory speed. Here is a summary of some practical ways to make a homepage, the following methods can make the page speed greatly improved .

  First, remember to help the page weight loss

Browsing a Web page is essentially downloading the contents of a Web page from a virtual host to a local hard disk, which is then interpreted by the browser. Download the speed of the page in the display rate accounted for a large proportion, so the page itself occupies less space, then the faster the browsing speed. This requires in the Web page to follow the principle of basics, such as: Do not use too large flash animation, pictures and other resources. A clean, concise page will give 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 interaction of Web page information, it is very convenient to run, because their data interactivity is good, can easily access, change the contents of the database, so that the site "move", such as: Forum, message board and so on. However, such programs must first be processed by the server, generate HTML pages, and then "send" to the client to browse, which has to consume a certain amount of server resources. If you use this kind of program too much on the virtual host, the page display speed will be slow, so it is not necessary, please use static HTML page as far as possible.

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

This is the problem of web design, a lot of webmasters in order to pursue the unified alignment of the page, the entire content of the page is crammed 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 will wait for all the content to be loaded before it is displayed, 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.

  Iv. change the access of ASP, ASPX, PHP and other files to. js Reference

This should be noted in ASP, ASPX, PHP and other programming, if you want to embed dynamic data in a static HTML page, and these dynamic data is provided by ASP, PHP and other programs, will use the following statement reference:, so that every time a person to 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 there are tens of thousands of people at the same time access, it will be executed 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 on the home page through < SCRIPT src=. /.. /"http://www.aaa.com/your JS file specific name" ></script> such code to reference the JS file. In this way, the task of data display to the client's browser to do, will not consume the server resources, display speed naturally quickly!

v. Nesting another page with an IFRAME

For example, if you want to insert some ad code on the homepage of the website, and do not want these advertising sites to affect the speed, then the use of the IFRAME is the most appropriate. For example, in the http://www.aaa.com/home page to insert some AD code method: Put these ad code to a separate page, and then on the homepage with the following code to embed the page, so that the ad page is not delayed due to the display of the entire first page, the code is as follows:

< IFRAME marginwidth=0 marginheight=0 src= "http://www.aaa.com/ServerPart.asp" frameborder=0 width=468 scrolling=no height=60 leftmargin= "0" topmargin= "0" ></iframe>

Where http://www.aaa.com/ServerPart.asp is the path to the referenced file.

  Six, pay attention to website counter Code placement skills

Put the counter in the Web page to count the site's access to traffic, for webmasters and advertising businesses to provide access to the basis, however, no matter how powerful the website statistics system, there will be a failure. If you put the statistical code directly in front of the page content, or in a table or div tag, then when the counter cannot be accessed, the table or div on your page will have a delay of several 10 seconds, resulting in a long time for the page to access. Therefore, to improve the speed of the site, it is necessary to pay attention to the location of the statistical code placement, the correct way is: Put the statistical code at the bottom of the page, and not with the page content in a table or div tag. You can place the statistic code directly at the bottom of the page code, or at the bottom of a table or div to place the counter. This way, when the counter cannot be accessed, your website speed will not be affected in the slightest.

  Seven, the knowledge of friendship links

Links between the Web site can increase the publicity effect of the site, do the logo image link more accurately describe the theme and positioning of the site, the publicity effect will be greatly enhanced, but the image links do too much, will inevitably affect the display speed of the page. Many webmasters like to directly cite the image URL on the friendship site, so that the picture must be loaded before it can be displayed, the access speed of each friendship site is not the same, the entire form must wait for the picture to be downloaded to show it, which greatly reduces the speed of the page. Therefore, do friendship links should try to do:

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

2. Place all the links on a separate page, and then on the homepage link on the page.

3. If the link must appear on the homepage, place the entire table where the link is located at the bottom of the page, because the page is displayed on a line-by-row basis, placing it at the bottom of the page without delaying the display of other content.

4. Link logo image download and then upload to their own web space, so that the speed of their own website space to decide not to be affected by the friendship site.

  Eight, the choice of web space

If the above methods are used, the spatial access speed is not ideal, then it may be your website space speed problem. When choosing a site space, we recommend that you use two-line space, which avoids the delays caused by network problems when other users of the site visit.

A practical way to improve Web page opening speed

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.