Key problems and solutions for Web Access speed

Source: Internet
Author: User
Tags html page php and reference client

   Web site access speed can directly affect the flow of the site, and the site's traffic is almost directly linked to the interests of the site, so the speed of the site has become a business and webmaster concerns. now the site more and more, many friends of the site to open the speed is not ideal. Perhaps open their own web site quickly, others open their own site but reflect the speed of full. This may be due to netcom and telecommunications and other wiring problems caused by, but most of the site because of their own problems affect the speed. How to improve the speed of Web Access? Let's talk about some of the key issues and solutions.

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 to open, if you encounter this situation, rather than seek better space, as well as through the optimization of the page code to achieve satisfactory speed. Here is a summary of some practical ways to make the homepage, the following methods can greatly improve the speed of the Web page.

  First, remember to help the page to lose weight

Browsing the Web page actually downloads the contents of the Web page from the virtual host to the local hard drive, and then explains 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 files access to the. 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 on the home page via < SCRIPT src=. /.. /" http://www.aaa.com/ your JS file specific name" ></script> such code to refer to the 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!

use an IFRAME to nest another page

For example, you want to insert some advertising code on the home page, and do not want to let these ads Web site impact speed, then, the use of IFRAME is the most suitable. For example, on the home page of the http://www.aaa.com/ insert Some advertising code method: Put these ads 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.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 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.

  Viii. The choice of website space

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



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.