ecometer

Minimize the number of CSS files and compress them

(Development)
#10

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: http://httpd.apache.org/docs/2.4/mod/mod_deflate.html

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