Extension:Minify

What can this extension do?
Minify bundles the YUI CSS compressor by Julien Lecomte and Isaac Schlueter with the JSMin Javascript compressor by Douglass Crockford and Ryan Grove.

When installed it automatically catches calls to RawPage.php and pre-compresses the CSS and Javascript output generated there. This can significantly reduce the size of CSS and Javascript files that are dynamically returned by Mediawiki, such as Mediawiki:Common.css and Mediawiki:Common.js. However, it does not affect the static files living in /skins/, etc.

The resulting files are functionally identical but have been stripped of user friendly formatting, comments, and similar elements.

Tests with files in use at the English Wikipedia suggest that in some cases the use of this extension can reduce CSS and Javascript file size by up to 50% (this is measured after gzip compression is also applied, i.e. the normal method of compression for data transmitted over the internet). Typically the largest share of the gains comes simply from removing comments.

Requirements

 * Mediawiki >= 1.10
 * PHP >= 5.0

Download instructions
You can download this extension via the MediaWiki extension distribution system, or via Wikimedia SVN.

Installation
This extension has a one-line installation and no configurable options. After copying the downloaded files to /extensions/Minify, simply add the following to LocalSettings.php:

Known bugs
In rare cases (generally involving poorly formed javascript), JSMin may produce code that is not functionally identical. See for a discussion of circumstance where this may occur. A test sample of javascript from the English Wikipedia did not reveal any cases where this was an issue.