Minimize the number of CSS files and compress them


Minimize the number of CSS files to reduce the number of HTTP requests. If several style sheets are used on all of the website’s pages, concatenate them into one single file.

Some CMS and frameworks offer ways to do such optimization automatically. The HTTP server can also be configured to compress and reduce the size of style sheets (see best practice #79).

With the Apache web server, simply add the following line in the .htaccess configuration file:

# compress css:
AddOutputFilterByType DEFLATE text/css

This instruction activates the Deflate mode which compresses all the style sheets between the server and the HTTP client.

Learn more about Deflate at:

This best practice should only be applied if it is coherent with your project's specifications.
Under CC-By-NX-SA license