Home arrow Help & Tips arrow Joomla Performance Tuning #1 : Module Cache

Joomla Performance Tuning #1 : Module Cache

User Rating: / 28
PoorBest 
Written by Editor in Chief   
Thursday, 25 September 2008
If you don't have a very busy website, chances are, you still don't care about Joomla performance tuning. But if you found this article through search, you are probably encountering slow performance from your Joomla website. You see hundreds of query from the page when you enable debugging. And in some cases, if you know Joomla caching, you just don't see the parameter on the module. Here's our first tip on how you can enable it and limit those query calls.

Joomla Modules

If you go to the Joomla Module directory, you will always see the PHP and XML file. The XML file stores the definition and parameters about that particular module. And in my experience as an end-user, I noticed that most of these modules usually don't go through proper design and implementation. Maybe the developer just thought of a cool idea to support some component and created a Joomla module in a flash.

Param Cache

What is param cache? This is a very special parameter in Joomla Module. And in most module that I have used, this is missing. This tells Joomla to cache the module when it is enabled. What does exactly happens when Joomla cache the module? For example, the module displays the latest 10 ads in an ads components. If the developer is good, the module might have 1 query, if he's not it might have 10. Yes, I bought a commercial component and a module came with it that stupendously executes 10 queries.

So when Joomla cache this module, it means the module will only execute the query once when it initially loads the page that displays the module. So when a second visitor visits that page, all it's doing is reading the cache (it's a file from your cache directory) from your server. There are no query calls and thus improves your website performance. It will only execute the query again when the cache expires. You set this expiration time on the Site Global Configuration.

Adding Param Cache

I have another website that became so busy this past few months. It was using Moset's Hot Property and Mosets Tree. It started pushing up my server load and it was slow. When I started debugging it, it was executing 100+ queries on the frontpage. I looked at all the modules that I was using and most of it was missing the cache param. You need to do 2 things: add the cache param on the XML file and enable caching on the module from the Administrator. After I've done these 2 steps, the query calls were reduced to 50%. That is a big performance boost.

  1. Editing the modules XML file.

    XML file is a specially formatted file. So you need to be careful where you add the param cache. You need to add this inside the <params> field.

    <params>
        <param name="cache" type="radio" default="0" label="Enable Cache" description="Select whether to cache the content of this module">
        <option value="0">No</option>
        <option value="1">Yes</option>
        </param>

        .
        .
        .
    </params>

  2. Enabling module caching from Administrator.

    Image

Comments (15)add feed
... : lucky123
Ugg boots on sale, http://www.nfljerseys2012.org cheap ugg sale on our ugg store with low price and quality gurantee.Our UGGS boots On Sale store gives you more http://www.newuggbootssale.co.uk discounts with 100% sheepskin guarantee. All UGGS boots keep you as warm as possible even in terribleenvironment.Uggsboot http://www.uggsbootoutletonline.com                   became  http://www.uggbootsalecheap.net popular in the 1970s,and it emerged uggs outlet as a fashion trend in the United States in the late 1990sandasa world-wide trend in  http://www.truereligionjeans2012.org
the late 2000s. True Religion Brand Jeans - Shop online for the latest trends in denim and fashion.There are so many series of authenic true religion jeans in our http://www.truereligionjeans2012.org store,Choose True religion jeans choose us!True religion jeans online store supply various cheap true religion jeans for men and women.
December 19, 2011
ugg boors : amanda1114 : http://www.inuggshopping.com
a very useful article~~~~~thank you very much ...I got it~~~
December 13, 2009
Great artical : hannahjay : http://projoomla.info
Great tips you guys are great thanks
October 15, 2009
nice work man, thank's
September 3, 2009
Joomla Cache Roundup : IntownWebDesign : http://www.intownwebdesign.com
Thanks so much for this post. I did not know it could be that easy to add the cache param to a module.

I have been looking for a Joomla Cache Roundup, I want to know what the different Cache Components are, Core, JoomlaTwork, etc and what the pros and cons of each are.

images/grin.gifoes anyone know if this exists?

Thanks!
June 5, 2009
Adding the cache param really helps, I've done it on one of my websites powered by Joomla.
April 16, 2009
... : nhungxinh
サイト制作
秋葉原 メイド
ペット火葬 つくば
つくば ペット火葬
つくば ペット霊園
つくば ペット葬儀
立食パーティー用プレート
でしこ
soul source production
ベトナム シーフード
高収入 アルバイト
高収入 アルバイト
アパレル 求人
アパレル 派遣
風俗
風俗
デリヘル
美少女ゲーム
高収入求人
高収入求人
ソープランド
出会い
デリヘル
March 14, 2009
Iisus Hristos .org back up : alfredo2 : http://www.isushristos.org
Hy, how can I back up my entire website?
March 1, 2009
... : admin
Well, you need to know what you're changing to confirm it. So for example, disable a module cache. Turn on debug and get the query totals. Then enable it back and get the query totals from debug again. You should see that the query is less now after initial load. But of course you should have caching on.
February 19, 2009
... : ILJ
Is this confirmed working?
i add the codes but dont seems to reduce queries or loading time. need to do something else to see the changes?
February 17, 2009
... : Emagin
I am just trying this on the default mod_custom.xml
Will it work there as well? Seems like a lot of stuff you do in modules is custom web 2.0 stuff, so that would be great in there!
January 14, 2009
Nice tip : tomthornz
Does this only work if the Joomla cache is turned on via Global Config? Or is it separate?

I've never used the cache before, is turning it on likely to cause issues with components etc?
November 19, 2008
Thank you for the article. I really had problems with the performace of the site. The component caching helped to improve it.
November 17, 2008
Excellent : joomlapanel : http://joomlapanel.com
Very excellent and very useful to speedup my joomla performance
November 13, 2008
Nice : cypher109
Nice article, thanks for it. Surprisingly i never thought of using the cache either. I will now though.
October 17, 2008
Write comment

You must be logged in to post a comment. Please register if you do not have an account yet.

 
Joomla Themes Joomlart Joomla Template Club Joomla Comment System Cheap Joomla Hosting from $4.95
Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal. None of the text or images in this public website may be copied without the expressed written consent of the authors. Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use







Joomla Hacks German Lang French Lang Italian Lang Spanish Lang Japanese Lang Chinese Lang
About Advertise Register Login