In the actual project, why do multiple CSS, JS files to implement merging and compression? (You know this is a primer)

Source: Internet
Author: User

one of the most important best practices in Web performance optimization is reducing HTTP requests. The most important way to reduce HTTP requests is to merge and compress JavaScript and CSS files.

When writing CSS, we should pay attention to some details to control the size of the CSS file, such as: Global style, inheritance style, abbreviation style, space, comments, etc., you can also use the online tool to compress your CSS file to reduce the size of the CSS file, but the compressed CSS file in the maintainability, The recognition aspect has become particularly weak. But the more complicated situation is that if you have multiple CSS and multiple JS files in your page, you may not be able to handle them well.


Multiple css, multiple JS files for automatic merging, compression principle :


There are two major benefits to this :
1, when the page loads only requests the program merges the compressed C.CSS file, this reduces the HTTP to the CSS file request number!
2, not to A.CSS and b.css compression, to maintain the A.CSS and b.css easy to edit, easy to identify.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

In the actual project, why do multiple CSS, JS files to implement merging and compression? (You know this is a primer)

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.