The so-called web page weight loss refers to the structure of the Web page itself and some of the optimization of the code, not just by some means to compress the size of the Web page file. Web page weight loss has always been a hot topic. What we do in general is to remove the redundant code. Today's Good Wine Network small series to share some of their own experience.
Web page div and CSS refactoring
The biggest significance of the page weight loss is to reduce the garbage code, so that search engine spider smooth crawling on the web, and crawl to the appropriate content. div and CSS Architecture pages have the advantage of being open quickly and more conducive to capturing the content of the engine spiders. But because Div and CSS code will produce a lot of CSS code, and this part of the code will prevent spiders crawl the title part of the page, so we need to separate the CSS to save.
JavaScript scripting code for weight loss
The redundant Code of the Web page includes the viewstate generated by asp.net, the JavaScript code inside the Web page not encapsulated, the page garbage code generated by other system automatically, etc.
Generally, If we don't use some of the default templates or methods provided by ASP.net, ViewState can be clear, and if we just try to generate HTML pages with different modules, the original HTML template page can also block viewstate code.
Web Text weight Loss
The Web page text content is too long, the user opens the page the speed to be slow, the entire page cannot set the label, then the user experience greatly discounts. In this case, the general choice of the article for pagination processing, so that each page length of not more than 3 screen. This is not only beneficial to the user experience, but also to search engines have great benefits.
Web images of weight loss
When you open a page, the picture file on the page is too large to wait for a long time. Once this time exceeds the limit that the people can afford, the user will close the page. The same is true for search engines, crawling out of the picture, when it thinks this picture is too big to download in a short time, it will be considered that the picture has no actual value, and thus give up the collection of pictures, or reduce the score on the site.
Therefore, we in the production site, in addition to looking at the quality of the picture, but also to pay special attention to the size of the Web page, so that it can be downloaded in the shortest possible time to complete.
Flash weight Loss
We do on the web to lose weight, pay attention to try not to use flash to reflect the key parts of the entire page, such as navigation, content, links and so on. Or use an HTML map to make up for the site, the specific way is in the footer section with HTML links, in the HTML format links to add a sitemap file links, so that the search engine can use this remedy to find links.
If the site is full of flash, we must add a text form link in the homepage, link to a simplified version, no Flash page, the page needs to include some of the text content of Flash. This will not only help improve the user experience, but also the search engine included in the page is very good.
This article from China's best wine Investment Network Yang Original, from: http://www.9928.TV/, reprint please keep the link.
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.