The Joomla! Extensions Directory ™


Homepage Cache Plugin

Update (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!

Report Extension

 

Images

 

2014-08-11
Reviews: 7
Works great. Just what I needed! Cache breaks other pages (rating,comments...) and I only need it on homepage (70% page hits). Although this plugin does not have many options it is extremelly light-weight and does what it says. Downside is lack of documentation, at first I did not know if native Joomla cache has to be turned on (plugin or global conf) and still do not get priority levels.
Thanks 5+
2014-05-12
Reviews: 13
there are some popular extension that breaks when default cache is set as enabled.

I like the flexibility of this extension instead of caching the whole site especially when I have a lot dynamic content.
2013-08-16
Reviews: 4
This plugin works OK but I've found that it prompts me to update to a newer browser.
Owner's reply

Hi biguphosting!

I'm sorry you ran into an issue when using the plugin. Actually the Homepage Cache doesn't do anything to prompt users to upgrade to a newer browser, but your site template might actually be doing that (let's say with a Yootheme or RocketTheme template) since I've run into that issue myself on the orware site (which uses a Yootheme template).

It hasn't happened often, but I believe if someone visits your site at exactly the right moment (when the cache is being recreated) with an older browser (which would trigger the "upgrade your browser" message in those types of templates) then that particular page gets cached for everyone to see. Typically this feature is something you can turn off within your site template so it doesn't occur again, which may be something to try and might be helpful in your case.

The plugin itself is fairly simple and mainly provides the features I mention in the description above (cache the homepage specifically and nothing else, unless you specify a few additional pages that should be cached) so what you're mentioning is not being generated by the plugin itself (the plugin is just caching that particular response being returned by your template when a user with an older browser visits the page right at the moment when the old cache has become stale and a new one has to be recreated, which is then unfortunately displayed to subsequent users).

I've been meaning to take a look at this and see if I can go ahead and add the ability for the cache to be created on a per-browser basis (so Chrome browsers will have a separate cache from Internet Explorer browsers, etc.) and I believe that will help to resolve this type of issue from affecting other site visitors in the future (let's say in this case upgrade page was triggered by someone using Internet Explorer 7.0, but IE 8.0 would be OK...using this approach only the IE 7.0 folks would be affected and the IE 8.0 folks would have a separate, normal looking page returned).

If you ever have any issues feel free to send a direct email to support@orware.com and I'm always happy to help sort through bugs like this and figure out a solution!

-Omar