Joomla, Speed up Mootools Loading


Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity, line: 1 in /srv/users/serverpilot/apps/robertwentcom/public/wp-content/themes/rw/inc/extras.php on line 114

Joomla slows down page loading times by loading the full uncompressed Mootools 1.1 Javascript library.

Here's an easy way to speed it up...

It's alot faster to load a compressed script directly from google rather than load it from your own server.

To do this we need to overide the loading of the built in script in your templates index.php file

Just above the line:

<jdoc:include type="head" />

Insert the following code:

<?php $document =&JFactory::getDocument();unset($document->_scripts[$this->baseurl . '/media/system/js/mootools.js']);?>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("mootools", "1.1.2");</script>

The compressed version of the script is 18kb rather than about 80kb.

By loading the script directly from google your browser can download the script at the same time as it downloads your sites content.

Some more speed tips are:

Stopping mootools from loading

Adding Leverage Browser Caching to .htaccess

Add gzip compression through .htaccess