How code optimization is implemented

Source: Internet
Author: User

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

Code optimization is the HTML source code in the page to make the necessary adjustments to improve the page has a good line, the page after optimization, on the one hand can effectively streamline the redundant code page, speed up the page display speed, while reducing the page occupy the search engine server storage space, So as to improve the user experience of the page and search engine friendly, on the other hand can highlight the page theme, improve the relevance of the page.

Main steps: Streamlined code, head optimization, weight label usage and picture optimization. In these four links, the streamlined code is the most basic and fundamental.

1. Streamlined code refers to the removal or simplification of the code in the page, so as to reduce the volume of pages, improve the user experience of the page and search engine optimization of the purpose.

The streamlined code is divided into five small steps: 1. Clean up garbage code, 2.html tag conversion, 3.css optimization, 4JS optimization, and table optimization.

1.1 Spam Code is the non-essential code that does not affect the normal display of the page in case of deletion. Do not underestimate the code, he occupies a lot of space, not only affect the performance also affect the search engine calculation time, so the code is best handwriting, if used frontpage,word,dreamweaver, and other tools to write, the resulting garbage code will be very much, so manually clean out.

1.2 HTML tag conversion, mainly refers to the use of short tags to replace in the Web page to achieve the same effect of the long label. For example, two weeks is a bold font, but more than five characters, if a lot of pages, it will produce a lot of redundant code.

1.3 CSS Optimization. CSS optimization is primarily to change the way CSS is invoked, and to avoid using CSS to define styles for important content.

Use the Div method to make the page, on the one hand to prevent garbage code, on the other hand can reduce duplicate code. This approach is very friendly to search engines.

1.4 JS Optimization. JS is very unfriendly to the search engine. Currently, search engines cannot parse JavaScript-generated pages or content. So the important content can not be generated with JS script;

1.5 table optimization, the traditional page is basically used table. But this approach is very unfriendly to search engines, so it is not recommended to use table

Actual Combat: My website GSM alarm system All pages are handwritten, almost no redundant code, is the label conversion, try to avoid long notes.

There is CSS optimization, all the styles I put on the external page, just add a reference to the head, which greatly reduces the volume of the page.

And I wrote each page in a div way.

There are JS optimization, all the important content is not using JS, with JS just show some special effects, but JS code is also written in the external page, but to the bottom of the page to add a reference, do not head, if the head will also affect the performance of the page

And my website GSM alarm system all the pages follow the rules described above. If the above brother, if the wrong place, you can give advice, brother greatly appreciated. Well, that's it for today, and the next section continues.

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.