About three ways to compress the size of a Web page file

Source: Internet
Author: User
Keywords Three talk.

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

When everyone focused on content optimization and outside the chain optimization, those successful website, through the optimization of the details, so that the site to get a better user experience, so that their own site from the fierce competition to stand out! SEO optimization of the current site details involved in all aspects of the author of this article, Focus on the analysis of the Web page file size in the site optimization role, so that everyone knows that a small detail of the processing, often can get the truth of the big return!

If you turn back the time to 10 years ago, if you use that speed to open the current Web page, perhaps there is no internet prosperity now, because many sites are not open, want to see a Web page is very laborious, natural internet to cultivate the ability of netizens will be greatly reduced, no netizen support, the Internet site more, That's no use! Now the site can be opened faster because of the impact of the Web page speed of three has made considerable progress in a way, one is the speed, and the other is the server to deal with a huge increase in the rate, there is a lot of stationmaster know how to optimize their own web pages, so that the Web page file become a little bit, It will allow users to gain a fast surfing experience! Since the Web page compression has a considerable importance, then as a webmaster, how to enable a large number of web pages to achieve a fast and good compression effect? The following author from three aspects to talk about!

One: For website pictures, video and audio and flash optimization

Web page size often has pictures on the page, video and audio or now less use of flash caused, if the page of these elements, only text content, the nature of the entire Web page can be reduced, but without these elements, the Web page looks too monotonous, the user is not attractive enough, In particular, some video sites, the main content is mainly video, so in the can not reduce the application of these elements, the remaining is to find ways to compress these elements, but for the picture of audio and video, can be changed through the format is relatively easy to achieve! In addition to playing Flash, Video audio control can also be optimized by the way the code to achieve, so that can greatly reduce the size of the Web page, so that users realize the pleasure of high-speed surfing!

Second: For Web page HTML, JS, CSS code optimization

We know that any element on the Web page will eventually be converted into code, the user's browser to download to the local, and through the browser into the corresponding page, this shows that the size of the page can also be optimized by the page code to control, a good optimization of the page code, often in the compressed web page size Can improve the effect of more than 30%, so for HTML,JS,CSS code optimization is more important!

For example, we use the document type code by using the backward-compatible ellipsis mode! DOCTYPE HTML instead of a traditional DTD, you can save more than 180 characters for a Web page, as well as a div structure that saves code more than a table structure, and files pasted from Word, or WordPad, can also be manipulated by manipulating the source code to clear redundant code. Of course, now a lot of CMS system, for this aspect has been a certain optimization! In addition, if the page is very long, then through the paging method, can also reduce the size of each page! In addition to the call jquery and other library files, you should also select some smaller files, as long as the need to meet the line!

Three: Use gzip compression to compress Web page files

This way, there is always a certain risk, but this compression ratio is very high, or even more than 80%, but the risk is search engine spiders to such a compressed file, often return code 200 0 64, in other words, is not conducive to the content of the site, so for the important content of the site, or less use is better!

Of course, in addition to the above three methods, there are many unknown methods, if webmaster friends know, also take out to share, after all, through collective efforts, can let the entire Internet user experience can be raised, so that users really enjoy the pleasure of surfing the internet! This article source: www.lovegx.com A5 Starting, reprint please specify, thank you!

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.