What's Css Aggregation?

I am confused with CSS Aggregation. Could anyone describe.

When I googled, its redirecting me to some drupal stuff.

Is the CSS Aggregation deals with the Sprites, compression of css stuffs?

Kindly guide me.

Thanks, Easwar

1 Answer

It's just a process of combining multiple CSS files into a single file. This is often combined with minimizing the CSS file as well. As a result, your page only contains a single, quite small CSS file instead of many large ones, thus speeding up downloads.

This is often a separate process, because for development it is easier to have multiple CSS files, each for a specific purpose, and each richly commented. During deployment to a production server, this development CSS can be aggregated to a single file.

Of course your server side templating must be smart enough to understand this. If you have CSS references in your header template, it's hard to replace them. A better solution would be to have a collection of files to include and generate the HTML for that on the go. That way, your production website could include the aggregated CSS, while the development website could use the separate CSS's. Toggling between them is just a confguration setting.

A similar process can be used for Javascript.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest