Home arrow Help & Tips arrow Joomla Help & Tips arrow Joomla Tips #1 : Turning On Caching

Joomla Tips #1 : Turning On Caching

Print E-mail
User Rating: / 11
PoorBest 
Written by Editor (cowboy)   
Wednesday, 05 October 2005
Joomla TipsTo improve your Joomla website's performance, just turn on "caching" on the "Cache" tab from Joomla's Global Configuration. When caching is turned on, Joomla creates a static file or "cache" of your website data on the disk. When the static file is found, the system retrieves the data from the disk rather than from the database. This improves performance because it saves system resources by not making redundant SQL calls to the database. And it will also speed up the display time of the pages.

You can set cache refresh rate in seconds. If you don't constantly update your contents, you might want to set it longer. And to further improve it, go to all your modules configuration and select "yes" to cache option (not available in all modules).



Steps:

Click Global Configuration
Click Global Configuration


Click Cache Tab
Click Cache Tab


For Modules: Choose Yes To Caching
For Modules: Choose Yes To Caching


Submit your own help & tips!
Comments (2)add feed
... : redtreesystems : http://www.redtreesystems.com
While this was helpful, we were still a bit put off that there was no local caching going on. We were able to overcome this problem by hacking index.php a bit.

The first item of business is to get rid of the section near initGzip() that says:

header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' );

This code ensures no browser will attempt to cache your site. This really affects bandwidth!

Next in line was to implement a check if any of the database tables have been updated (except jos_session). If the client sends an If-Modified-Since header that is prior to our maximum database modification, we can safely return a 304 - not modified.

Finally, we implemented a simple Caching class that saves each REQUEST_URI seperatly. Components search, and some of our custom ones were intentionally left out, for various reasons.

You can check out the result for yourself by going to http://www.redtreesystems.com. Click around a bit. Fast, yeah? But here's the real treat:

curl -H "If-Modified-Since: Fri, 07 Oct 2005 02:34:50 GMT" -i http://www.redtreesystems.com />
Returns:
HTTP/1.1 304 Not Modified
images/grin.gifate: Fri, 20 Oct 2006 00:15:32 GMT

Hope this is useful to somebody.
October 19, 2006
Oops, posted the wrong date on the curl command, should be one year forward, not one year back.
October 19, 2006
Write comment

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

 
< Prev   Next >



 
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