Select Page

Reduce HTTP requests with Minify4Joomla

Reduce HTTP requests with Minify4Joomla

BETA release

Attention: this kind of mod is intended for developer or #Joomla site with high number of visitors and facing performances issues.

A small HOWTO, a more comprehensive documentation can be found in my WIKI. A new forum board has also been started for support, bugs and your comments.


The component com_minify like any #Joomla component

Check proper installation

  1. Use the menu entry "Check/System", at least the file cache at components/com_minify/cache has to be writable by apache/PHP!
  2. Activate the URL Builder under "settings"
  3. Drag and Drop the Bookmarklet tool in your Firefox Bookmark Toolbar


so it look like:


Go to your Joomla frontend

And click on the bookmark tool "Create Minify URL’s", a new tab or pop up will open:


In A, the tool will present You all JavaScript and CSS it has detected in the page, Remember this may change if you are a public or a registered user, this may also change if you remove or add module and  plugin!

Removing JavaScript/CSS HTTP requests

Now in that list, decide which JavaScript files can be combine (most of the time it is all, but you may want to create bundle of them if that is making sense), simply click on the blue link you want to add to the combine list.

Here for the example I select them all (also add securityimages.js):



  • That I have a base Joomla1.5.8 and did not install Joomla in the root directory of my local web server.
  • You can not mix JavaScript and CSS in one minify URL, this is limitation of HTML tags that are different for JavaScript and CSS.
  • mootools.js and caption.js can be group under the group name jbasejs for example and thus reuse.

Click now the [Update] button, the URL query Builder present you the text below that is self explanatory

Place this URI in your HTML to serve the files above combined, minified, compressed and with cache headers.

                                                      components/com_securityimages/js/securityImages.js (opens in new window)

<script type="text/javascript" src="/components/com_minify/b=Joomla1.5.8&amp;f=media/system/js/mootools.js,

How to serve these files as a group

For the best performance you can serve these files as a pre-defined group with a URI like: /components/com_minify/g=keyName

To do this, add a line like this to /components/com_minify/groupsConfig.php:

return array(     ... your existing groups here ...

       ‘keyName’ => array(‘//Joomla1.5.8/media/system/js/mootools.js’,

Make sure to replace keyName with a unique key for this group.

In your Joomla! templates /templates/xxxxxxx/index.php

  1. Remove all reference to static JavaScript include by first commenting them if you have no backup.
  2. Add this line in the <head> of your template
    <script type="text/javascript" src="/components/com_minify/b=Joomla1.5.8&amp;
    or better this one if you did defined a group fjs (frontendjs)
    <script src="/Joomla1.5.8/components/com_minify/?g=fjs" type="text/javascript"></script>
  3. Remove all dynamically added JavaScript by : see later in article

You did avoid 3 HTTP requests for including JavaScript, and only need one now!

Do the same for all CSS, here it is 6 CSS file for the default templates rhuk_milkyway

  • Remove all reference to static CSS include
  • Add this line in the <head> of your template
    <link rel="stylesheet" href="/Joomla1.5.8/components/com_minify/index.php?g=css" />

    You did avoid 6 HTTP requests for including JavaScript, and only need one now!

    Remove all dynamically added JavaScript

    • This is currently a bit dirty, as Joomla! do not have any hook where com_minify can detect that a Joomla! plugin is trying to  insert a new JavaScript or CSS in head of the document. In fact minify would have its place in /libraries ideally.
    • I am trying to find a better/more elegant solution than this one (modifying JResponse), but this one work at the moment.
    • If you start modifying the front end, I highly recommend you to minify also the Joomla back end template.

    Open libraries\joomla\html\html\behavior.php and alter the class JHTMLBehavior

    and comment lines like


    when you are sure that you did minify the script caption.js for both front end and  back end.

    Test proper operations

    1. Test both your front end and  back end!
    2. Using YSLOW or by looking at HTML source code, check that not any other JavaScript or CSS is inserted anymore except by com_minify
    3. Check the cache content
    4. Switch the URL builder OFF for non obvious security reasons.


    My site use it NOW 🙂 but not for all js and css at the moment

  • About The Author

    Cédric Walter

    I worked with various Insurances companies across Switzerland on online applications handling billion premium volumes. I love to continuously spark my creativity in many different and challenging open-source projects fueled by my great passion for innovation and blockchain technology.In my technical role as a senior software engineer and Blockchain consultant, I help to define and implement innovative solutions in the scope of both blockchain and traditional products, solutions, and services. I can support the full spectrum of software development activities, starting from analyzing ideas and business cases and up to the production deployment of the solutions.I'm the Founder and CEO of Disruptr GmbH.