Menu

Homepage Cache

March 21st, 2013

Homepage CacheUpdate (2013-03-20): Just added in the ability to set your own custom cache lifetime value.

This caching plugin is a more specific version of the page caching system plugin that comes default with Joomla. I’ve never liked how the default System Cache Plugin cached all pages on your site once enabled because that seemed to cause issues with pages that were intended to be more dynamic (hence, users would use the Conservative or Progressive Caching options instead from the Global Configuration).

In my case, I thought it would be nice to enable page caching, but only for a few select pages (e.g. the Homepage) especially if only about 10 or so pages (out of let’s say a couple hundred) receive the bulk of the requests (e.g. the Homepage receives 70+% of pageviews).

So I set out to modify the default Joomla plugin and add in the capability to cache the Homepage out of the page, with the additional options of adding in additional relative URLs to be cached on your site.

The result is this Homepage Cache System Plugin and I hope you enjoy it!

After putting this into production on my site for the homepage it produced the following improvements.

Here’s the before example:
Processing Time: 1.354 seconds / Memory Usage: 10.31 MB (10,814,760 Bytes) / Database Queries: 77 Queries Logged

Then I went ahead and installed the homepage caching system plugin and turned it on (after making sure the Homepage Cache was set to be the last System Plugin executed…at the very least it needs to be ordered after the System SEF Plugin, otherwise you’ll run into a weird rendering issue on subpages with beez_20, which is what happened to me while I was initially testing).

That’s it if you want to enable caching of your homepage…you can also open the plugin’s configuration page and specify additional pages you want cached.

Here’s the after example:
Processing Time: 0.353 seconds / Memory Usage: 4.01 MB (4,202,216 Bytes) / Database Queries: 8 Queries Logged

Enjoy!