The so-called code optimization refers to the equivalent of the program code (meaning does not change the running result of the program) transformation. The program code can be an intermediate code (such as a four-tuple code), or it can be a target code. The equivalent meaning is that the transformed code runs the same result as the code before the transformation. The meaning of optimization is that the resulting target code is short (shorter running time, smaller footprint), and time-space efficiency is optimized. Main steps: Streamline code, head optimization, weight tag usage and picture optimization. In these four links, the streamlined code is the most basic, the most fundamental. Thin code is the elimination or simplification of the code in the page, so as to reduce the page size, improve the user experience of the page and search engine optimization. The thin code is divided into five small steps: 1. Clean up the junk code, which is the non-essential code that does not affect the normal display of the page in the case of deletion. Do not underestimate these code, he occupies a lot of space, not only affect the performance also affect the search engine computing time, so the code is best handwritten, if used frontpage,word,dreamweaver, and other tools to write, the resulting garbage code will be very much, so manually clean out. 2.html tag conversion, HTML tag conversion, mainly refers to the use of short tags to replace the same effect in the Web page 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. 3.CSS optimization, CSS optimization. CSS optimization is primarily about changing the way CSS is called, and avoiding using CSS to define styles for important content. Use the Div+css method to make the page, on the one hand to prevent spam code, on the other hand can reduce duplication of code. This approach is very friendly to search engines. 4.js optimization and table optimization; JS optimization. JS is extremely unfriendly to the search engine. Currently, search engines cannot parse the page or content generated by JavaScript. So the important content can not be generated with JS script; 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 6. Try to use less useless pictures and flash. Content index sent by the search engine crawler, do not know the picture, only according to the picture "Alt,title" and other attributes of the content of the image to determine the content. For the Flash search engine crawler is a blind eye. 7. Try not to use the table layout, because the search engine on the table layout nested within 3 levels of content lazy to crawl. Search Engine crawler is also relatively lazy, hope you must keep the code and content within 3 levels. The basis for optimization is to perform data flow analysis and control flow analysis of the code. such as dividing a DAG, finding loops, analyzing the variable's fixed points and reference points, and so on. The most commonly used code optimization techniques have the removal of redundant operations, cyclic invariant code extraction, strength weakening, transformation of cyclic control conditions, merging known amounts with replication propagation, and removing noneWith assignments and so on.
Divcss layout and web standards for site optimization