CSS / JS Aggregation in drupal

CSS / JS Aggregation in drupal

Posted byKala,3rd Apr 2017

In Drupal, we can break up the site’s CSS and JavaScript files into smaller files to make maintenance easier. But HTTP requests for all these files slower the page will load. Therefore, combine (aggregate) the many individual CSS and JS files into one large file to reduce the number of HTTP requests to improve the front-end performance of a website.

Drupal's CSS file aggregation is disabled by default.For enabling it

      - Go to the Administer » Site configuration » Performance page.
      - Check the Enabled checkbox for Aggregate and compress CSS files.
      - Click the Save configuration button.

One of Drupal’s best features is CSS or JS file Aggregation. Even though, it has some limitations such as forcing the visitors to download multiple copies of the same files over and over again and also the old files are deleted when the site caches are cleared will cause anonymous visitors continue to receive a static page. 
The AdvAgg module resolves all the above problems. It provides pluggable methods of compressing each of the CSS and JS bundles to make them even smaller and also it can load some of the common CSS and JS files from a 3rd party CDN. For better performance, all sites should use AdvAgg module.