Knowledge Base

How to optimize Joomla

This article describes specific steps you can take to optimize a Joomla site.

Optimizing Joomla

Joomla includes several configuration options that you can use to help improve your site's speed and responsiveness. The procedures below show how to configure these options so they are optimized for high performance.

The settings described in this article are for Joomla 3.4. Earlier Joomla versions may not include some of these settings.

If you configure the settings as described below and your site's performance is still not at the level you want, there are additional options:

Caching

Joomla includes a built-in caching feature, but it is disabled by default. To enable caching for your site, follow these steps:

  1. Log in to Joomla as the administrator.
  2. On the top menu bar, click System, and then click Global Configuration.
  3. Click the System tab.
  4. Under Cache Settings, in the Cache list box, select ON - Conservative caching.
    With conservative caching, all site visitors see the same cached content (this is how caching works on most sites). With progressive caching, the site caches content for each unique visitor. This is a resource-intensive process and can negatively affect site performance. For performance reasons, you should only use conservative caching (or no caching at all).
  5. In the Cache Time text box, type the maximum length of time (in minutes) that Joomla should store files in the cache until they are refreshed.
    If your site content does not change frequently, you can set the cache time to a longer interval. Similarly, if your site content updates frequently, you should set a shorter cache time interval.
  6. Click Save.
  7. On the top menu bar, click Extensions, and then click Plugin Manager.
  8. In the Search box, type cache and then press Enter.
  9. In the Status column for System - Page Cache, click the red X icon to enable the plugin. Caching is now enabled for Joomla.
Apache optimizations

You can add some Apache directives to the .htaccess file in Joomla's root directory that help decrease page load times for your site.

Compression

The Apache mod_deflate module enables you to compress output. This both saves bandwidth and ensures faster page download times. To enable output compression for Joomla, follow these steps:

  1. Open the .htaccess file in your preferred text editor.
    If the .htaccess file does not exist in the Joomla directory, create it.
  2. Add the following lines to the .htaccess file:
    <IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript
    </IfModule>
    
  3. Save your changes to the .htaccess file. The changes take effect immediately.
Browser caching

The Apache mod_expires module enables you to instruct web browsers how long to cache certain types of content. This both saves bandwidth and ensures faster page download times. To enable browser caching directives for Joomla, follow these steps:

  1. Open the .htaccess file in your preferred text editor.
    If the .htaccess file does not exist in the Joomla directory, create it.
  2. Add the following lines to the .htaccess file:
    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresByType image/gif "access plus 1 month"
        ExpiresByType image/jpeg "access plus 1 month"
        ExpiresByType image/png "access plus 1 month"
        ExpiresByType text/css "access plus 1 week"
        ExpiresByType text/javascript "access plus 1 week"
        ExpiresByType application/javascript "access plus 1 week"
        ExpiresDefault "access plus 1 week"
    </IfModule>
    
  3. Save your changes to the .htaccess file. The changes take effect immediately.
JavaScript and CSS files

You can help reduce your site's page load times by optimizing JavaScript and CSS files. This process includes:

  • Combining JavaScript and CSS files. This reduces the number of HTTP requests required to load a page.
  • Minifying JavaScript and CSS files. This reduces the amount of bandwidth required to load a page.

There are several Joomla plugins that enable you to do these optimizations; the JCH Optimize plugin is one of the most popular. To install this plugin, follow these steps:

  1. Download to your computer the JCH Optimize installation .zip file located at https://www.jch-optimize.net/downloads.html.
  2. Log in to your Joomla site as the administrator.
  3. On the Administration page, on the top menu bar, click Extensions, and then click Extension Manager.
  4. Under Upload Package File, click Browse.
  5. Locate the plg_jch_optimize_4.2.1.zip file, and then click Open.
    The exact filename varies based on the version you download.
  6. Click Upload & Install. Joomla installs the extension.
  7. On the top menu bar, click Extensions, and then click Plugin Manager.
  8. In the Search box, type jch and then press Enter.
  9. In the Status column for System - JCH Optimize, click the red X icon to enable the plugin. The icon changes to a green checkmark when the plugin is enabled.
  10. Select the check box for System - JCH Optimize, and then click Edit. The JCH Optimize configuration page appears.
  11. Under Automatic settings, click Minimum.
  12. Click Save & Close.
Developer debugging

Joomla includes two options to help developers debug and troubleshoot problems. These options can consume system resources and negatively affect performance, so they are disabled by default.

You should only enable these options if you need to troubleshoot a specific problem. To verify that these options are disabled for your site, follow these steps:

  1. Log in to Joomla as the administrator.
  2. On the top menu bar, click System, and then click Global Configuration.
  3. Click the System tab.
  4. Under Debug Settings, confirm that the Debug System and Debug Language options are set to No.