Optimize JA T3 Framework on your Joomla website

After a long long time, I’m back again ūüėÄ

I’m give you a little trick to speed up your Joomla website and optimize its loading time.

If you are using the JoomlArt.com’s JA T3 Framework, which is really great, you might experience slow joomla website and long wainting times until something shows up!

Pages being slow are a pain for the visitors and might make them go away from your website.

I found out that if you enable the CSS and JS¬†optimise¬†options from your template’s settings page, the requests made to the¬†optimised¬†CSS and JS files are redirected multiple times which causes serious performance issues and slows down your pages! Strange huh??

 

That is because of a bug in the JAT3 base system plugin. Here is the fix:

Open the file:

<JOOMLA_ROOT>/plugins/system/jat3/head.php

Replace the “buildURL” function (from line 814 until 835) with the following:

 

    function buildURL($url)
    {
        if (JPluginHelper::isEnabled('system', 'languagefilter')) {
            $lang_codes = JLanguageHelper::getLanguages('lang_code');
            $default_lang = JComponentHelper::getParams('com_languages')->get('site', 'en-GB');
            $default_sef = $lang_codes[$default_lang]->sef;
            $app = JFactory::getApplication();
            $router = $app->getRouter();
            if ($router->getMode() == JROUTER_MODE_SEF) {
                if ($app->getCfg('sef_rewrite')) {
                    $url = JURI::base(true) . "/" .$default_sef. "/?$url";
                } else {
                    $url = JURI::base(true) . "/index.php" . "/" .$default_lang. "/?$url";
                }
            } else {
                $url = JURI::base(true) . "/index.php?lang=$default_sef&$url";
            }
        } else {
            $url = JURI::base(true) . "/index.php?$url";
        }
        return $url;
    }