Optimize CSS?

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.


-8 points

What are the techniques of optimizing CSS to improve web application speed and performance?



7 points

CSS can be optimized by compressing all different CSS files into one (or minimum number of files). Also removing all spaces and comments in the CSS file helps. This can be done using 3rd party CSS optimizer like: http://www.refresh-sf.com/yui/.

For my PHP based Drupal applications, I also compress my CSS files using smartoptimizer: http://farhadi.ir/posts/how-to-install-smartoptimizer-on-drupal.

In the end, do not forget to implement "Never expire" policy by setting far future time for your css files, so that the browser need not have to send the request for CSS again and again to the server.

Anonymous's picture
Created by Anonymous

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.