Minify is designed to improve the website performance.

This module provides the mechanism to render the page using minified version of HTML and JavaScript files.
Minified HTML is generated using regular expression, and JavaScript files are generated using GOOGLE Closure Compiler webservice. Minify also works perfectly with Boost module.

How Minify help

Minify removes the comments and whitespace which will help to reduce the file size. Smaller HTML and file size reduces the page load time and improve the website performance.

What is HTML Minify

It will remove all white spaces before and after HTML tags and unnecessary line breaks.
Before Minify

<div class="content">
                                 <div class="block">BLOCK</div>
                                 <div class="block">BLOCK</div>
                                 <div class="block">BLOCK</div>
                                 <div class="block">BLOCK</div>
                                 <div class="block">BLOCK</div>

After Minify

<div class="content"><div class="block">BLOCK</div><div class="block">BLOCK</div><div class="block">BLOCK</div><div class="block">BLOCK</div><div class="block">BLOCK</div></div>

JavaScript Minify

It will remove all white spaces before and after HTML tags.
Before Minify

function hello(name) {
  alert('Hello, ' + name);
hello('New user');

After Minify
function hello(a){alert("Hello, "+a)}hello("New user");
Original Size : 100 bytes gzipped (90 bytes uncompressed)
Compiled Size : 68 bytes gzipped (55 bytes uncompressed)

Advantages over Speedy

  1. No Drupal version restriction
  2. You can use Minify even if you modify any core JavaScript
  3. Minify does not hold pre minified JavaScript files set

Advantages over uglifyjs

  1. Minify relies on well know webservice i.e. GOOGLE Closure Compiler

Installation instructions

  1. Enable the module
  2. Goto Configuration > Performance in Bandwidth optimization section, select Minify HTML and Use Minified JavaScript files
  3. Hit Save configuration
  4. Selecting the Use Minified JavaScript files does not enough to improve performance, select Minify JavaScript files tab at top of the page to generate minified JavaScript files
  5. If Boost module is already enabled, clear Boost caches to regenerate page with Minify


If you are upgrading to 7.x-1.4, execute module update.

Like us on Facebook

Project information