Six ways to teach your Web page code optimization

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

With Baidu and other search engines on the site user experience degree of higher requirements, Web page code optimization has become a compulsory course for all webmaster, good optimization results will greatly reduce the volume of Web pages, increase user experience effect. Always wanted to write a page about the optimization of the Code article, today finally have time to share with you about my experience.

Optimize one: Clear the extra space on the page, because of the different personal writing habits, in the process of making Web pages there will always be a large number of spaces appear, greatly improve the size of the Web page, the general 100KB of Web pages, space occupies about 15KB, that is to remove space we can reduce the size of the Web page 15 %, this is undoubtedly helpful for the speed of the Web page opening.

Optimize two: Use div layout Web page. There are still many webmaster in the production site when the table layout, may take into account the compatibility of the Web page and the simplicity of the layout. But the disadvantages of table layout are obvious. Table layout will greatly increase the volume of the page, especially the nesting of multi-layer tables. When the search engine reads the page, it is likely that the Web page's nesting level is too many to abandon the crawl of the Web page. Therefore, the use of more concise code div layout Way, the effect is more significant.

Optimization three: Reduce Web pages on JavaScript dependence. JavaScript is unfriendly to search engines. A lot of JavaScript in the Web page will affect the spider's crawl and increase the volume of the page. Especially in the process of making navigation bar, the design method of Div is used as far as possible.

Optimize four: Try not to use inline CSS. Inline CSS is divided into the head area of the normal inline and in the label appears inline CSS, regardless of which will increase the volume of the page. Use the outward-style CSS as much as possible to reduce the volume of the page.

Optimize five: Convert HTML control mode to CSS control. Many webmaster habits in the label to control the content. For example, the IMG tag controls the size of the picture by width and height. Try to convert the code to an outward-style CSS, making the page code more concise.

Optimize SIX: gzip compress the Web page. This feature requires server control support. Gzip compression is generally able to 30%-80% the Web page compression, is the most important one optimization effect.

Above six points is my experience in the optimization of Nanchang Computer Training Network, we can use a variety of methods to test, my site original volume in the 70KB or so after the volume is about 10KB, the results are significant.

Related Article

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.