Compressing CSS to improve performance

There are many ways to compress CSS. If you have access to your web server configuration, you can add a compression handler to all files having a .css extension. This technique is explained here. But in many other cases you have to use a server-side language to accomplish this task, especially when you're on a shared host that limits your access to the backstage of your server. In such cases, you can exploit some useful techniques detailed in this article. Further, you can get even major benefits if you minify your CSS files as well. To accomplish this task, you can use a useful tool like YUI Compressor.

On production web sites, performance tuning is a must. Of course you should keep an uncompressed version of your CSS files if you wish to make some changes to the layout of your site. Remember that compression helps browsers to load faster your pages, so you should use whenever it's possible.

This entry was posted in by Gabriele Romanato. Bookmark the permalink.

Leave a Reply

Note: Only a member of this blog may post a comment.