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)