Consider Joomla! as a framework over which one can develop, integrate components and launch a professional feature rich web sites. Joomla’s flexibility and ease of usage makes it a popular CMS, which has resulted in a vast community and tons of extensions, only imagination can restrict the use of Joomla. Then why is Joomla slow?
Joomla itself is not slow, one needs to tweak settings and use the available inbuilt options to boost up performance. If Joomla developer’s were to optimize joomla performance by default, then it would be difficult for us to customize joomla and much more difficult to make functional changes. Its up to the user to get the maximum out of joomla by tweaking settings and optimizing Joomla framework. Default Joomla has lot of potential to be optimized for speed and performance.
To prove our point we investigated Joomla performance by analyzing a Joomla 1.5.9 default installation.
||Total Page Size (bytes)
||Total Loading Time ( @ 56 K)
|Joomla with Ja_Purity Template
|With GZIP On
|With GZIP + Cache
|CSS edits. Compression & Minification of site.
- Speed and performance of Joomla is largely dependent on the choice of template, followed by addons components / modules / plugins.
- Activation of inbuilt Gzip and Cache system does speed up the Joomla site.
- Cleaning up of CSS codes can result in a highly boosted Joomla performance in terms of decreased http requests and total page size.
- Compression and minification of CSS / JS files, similarly compression and optimization of pics / images is the key to speed up default Joomla.
- As a demonstration we called two css files with one line of code resulting in 1 less http request.
Points to ponder :
- We did not remove any of the modules / components from the default joomla installation.
- We used the inbuilt template “Ja_purity” for the above testing with default settings.
- The above results are based purely on minimal alterations of files.
- We did not run the CSS or JS files through the optimizers, the CSS / JS still have the white spaces, comments in them.
- It is still possible to bring down the HTTP requests down by another 20-30 % easily.
What all else could we have done :
- Optimize CSS / JS files to remove the white spaces or comments (which decreases the size of css / js files by 10-40%).
- Use of the commercial components or other Joomla extensions such as page cache, Query cache, cssjscompress plugin. (which further reduces the loading time and http requests).
- Combine the CSS / JS files in one (which brings down the http requests).
Points to remember :
- Each site environment and setup is different and might need different approaches to optimize. Not all the options shall work perfectly on every site.
- Some components such as (page cache, Query cache, cssjscompress) might even break the site. That’s why you see the forums filled with queries, questions etc…
- Whatever you try on your website, always remember to back up site first, then backup the file you plan to edit or explore. If you miss this step, god help you.
- For the ease of calculation, remember that each module or image increase the http request by 1. For example, if you have 20 pics on a page, that means additional 20 http requests.
Now lets attempt to understand the basics and concept of speeding up joomla performance.
How and where to analyze Joomla performance?
- Go to http://analyze.websiteoptimization.com/ > put in your url > hit analyze > put the capctha code > wait for few secs > analyze > save the screenshot or make a pdf of it.
- There are other online analyzers also. But we all use http://analyze.websiteoptimization.com/ . why? Because everyone uses it :P
Which parameters are important ?
- HTTP requests
- Total size
- Number of HTML / CSS images
- Number of CSS / JS (scripts) files.
- Size of CSS / JS / HTML images.
- Check for duplicate JS files.
- Check for NOT FOUND items.
The above parameters will give a idea of what is wrong and what needs to be corrected. One can overlook the “Red Highlights” at the bottom of the result page. As its not possible to meet the stringent limits and most of them will go back to Yellow or Green once you have optimized your site.
First things first - What’s available in joomla?
Joomla uses PHP to create the HTML pages that make up your website. These pages can be compressed using Gzip Compression. Most web servers support Gzip Compression, which can shrink your site's pages by 70% to 90%. This will result in reduced bandwidth and faster page loads for your visitors. Remember, Gzip Compression will use more of your server's processing power.
To enable Gzip Compression on your Joomla web site, go to your Global Configuration and go to the Server tab. Set GZIP Page Compression to Yes. To test your site after enabling Gzip check http://www.gidnetwork.com/tools/gzip-test.php and enter your website's URL. The test will tell you if your pages are Gzipped or not.
Cache (system cache)
Cache works great and should be turned on, either from Global Configuration and another way is to enable the "System Cache" Plugin from Plugin Manager. Sometimes enabling Cache does not go well with cyrillics or special characters used.
What can be avoided to boost joomla performance?
Number of modules.
The less, the better. Do not overload your joomla with extra modules, because each module add to http request, may even load its own JS or CSS file.
If you have a choice between components, pick up the efficient one. Uninstall the components not in use.
Evaluate the benefits before installing any plugin. Disable or remove the unwanted plugins.
Example : Many people use JCE editor and during installation they also install the "JCE Utilities Plugin".
Effect of JCE Utilities Plugin on Joomla :
- HTTP requests increased by 11.
- Loading Time increased by 50 Secs (@56 K.
- Increase in total page size by 225396 bytes.
Do one really need cool effects by sacrifing site performance and speed?
Real time monitoring (live users – stats)
Turn off all Joomla Stats and just use Google Analytics to keep track of your users. Statistics are generated by using lots of queries to database, All the third party statsitics module / components are heavy on your joomla. Google analytics gives you what you really want to track your users and other relevant data.
Manual tweaking for a faster Joomla
- Always try to have a lighter and simpler template. Put the templates through the analyzer before settling for one.
- If changing template is no longer a option, then cut down on template based features, such as users tools, specialized login modules, unpublish such modules and if possible remove their reference from css also.
2. CSS optimization
- Take a backup of your css files and then run them through online optimizer http://www.cssoptimiser.com/index.php, It reduces the file size by 10-30 % and removes the comments, white space between the css code. Remember, after this step the css file will no longer be human readable, so always backup your copy.
3. Java Scripts optimization
4. HTML Images
- Never ever ask the browser to scale a big picture for you. Use JCE editor to make autothumbs for you or upload your thumbnails manually. Resizing while downloading the picture means that the browser will download the full picture and then resize it for you.
- For pictures, compress them, use Irfan View, or in photoshop use the option "save for web". In any unoptimized thumbnail, it is possible to take away atleast 10KB each, just by opening and saving for web in photoshop.
5. CSS Images.
- These are the images loaded by your template and these images make up your template. If you have a simple template, the number of css images would be less.
- If your template offers many options, such as color, style, module style, drop down menus option. - then you need to manually edit the css files or your template's index..php to load only the required scripts (menu styles) or images of the color scheme opted etc.... By default, half of the css images can be disabled or references removed without any serious effect on the layout or appearance of your template.
6. Clean Up Joomla
- Remove unwanted / unused components, modules , plugins.
- Check for leftover database tables of old components or plugins and drop those tables.
- Optimize and repair the database tables. Use PhpMyAdmin for this.
- If the analyzer report states any "Not Found" query. search and remove that query. Not Founds or 404 errors have bad effect on speed. The server/ browser is left thinking about how to deal with this missing item.
7. Combining CSS or JS files to reduce HTTP requests and file size.
Many options available for undertaking this task, a bit complicated.
- Minify - A Joomla independent Script - That works from the root directory of Joomla.
- Com_minify - A Joomla component that wrap the engine minify.
8. Using CSS sprites to reduce HTTP requests and picture sizes.
Here are two good articles with examples of implementing CSS sprite technique.
Joomla! Extension Directory Page for Site Performance.