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;
    }

 

2 Replies to “Optimize JA T3 Framework on your Joomla website”

  1. Unfortunately, I couldn’t find the file you specified. Maybe it’s because I’m on jat3 v3. It’s a shame, becuase there is something going on with this framweork that makes it difficult to set up right.

  2. Hello, at first thank you for modified head.php. I have the latest, JA T3v2 (2.6.8) version, and not working with this code. When I try to load my website, comes an error message: Parse error: syntax error, unexpected ‘>’ in /JOOMLA_ROOT/plugins/system/jat3/jat3/core/head.php on line 828. My actual T3v2 version’s code is: public static 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) . “/en/?$url”;
    } else {
    $url = JURI::base(true) . “/index.php/en/?$url”;
    }
    } else {
    $url = JURI::base(true) . “/index.php?lang=$default_sef&$url”;
    }
    } else {
    $url = JURI::base(true) . “/index.php?$url”;
    }
    return $url;

    Can you show me some solutions about it? Can you rewrite this to make useable and optimized?

    Thank you very much

Comments are closed.