YSlow: Minify JavaScript and CSS


Strip unnecessary characters from JavaScript and CSS to speed up download times.

How does your site score on this recommendation?

Details from Yahoo!

Minification removes unnecessary characters from a file to reduce its size, thereby improving load times. When a file is minified, comments and unneeded white space characters (space, newline, and tab) are removed.

This improves response time since the size of the download files is reduced.



YSlow recommends:

Two popular tools for minifying JavaScript code are JSMin and YUI Compressor. The YUI compressor can also minify CSS.

In addition to minifying external scripts and styles, inlined <script> and <style> blocks can and should also be minified. Even if you gzip your scripts and styles, minifying them will still reduce the size by 5% or more. As the use and size of JavaScript and CSS increases, so will the savings gained by minifying your code.

Read More

Related PageSpeed Recommendations