Why APC Caching in Joomla Can Cause Confusion

The project manager of a very large company that we do work for with called us this evening and told us that they are trying to update one of the modules, and while the change to that module seemed to take effect in the backend, that change wasn’t reflected in the frontend. This issue immediately reminded us of the post that we have published some time ago: my Joomla changes are not showing. But, the moment we were about to ask her if they had cleared the cache, she continued: “…and we cleared all the cache!”. This meant that we had to look elsewhere…

So, we logged in to their Joomla website, and we tried updating the module (it was a simple custom HTML module), and, sure enough, our changes were not reflected. We cleared the cache several times – but still, it didn’t work. That was odd!

We then thought – could it be that we’re working on the wrong backend? So, we made a small change on one of the articles, and that change was reflected immediately. Which meant that we were working on the right website!

We then started suspecting the module – were we changing the right module? So we disabled it, and to our surprise, the module still showed on the frontend. We then tried to find a module that had the same location in the template, but we couldn’t find any. So, the conclusion so far that we were working on the right website and the right module, but any change to the module, including the completely disabling it, was not showing up on the website.

And so we thought about caching again, but this time we looked at the global caching in the global configuration. It was set to Progressive Caching (we’ve warned against using progressive caching before), and the cache handler was set to Alternative PHP Cache (APC, and no, it’s not the famous UPS company!). The cache time was set to 15 minutes. After looking at these settings, we understood exactly what was going on…

You see, APC is a caching mechanism that runs on a lower level than Joomla – meaning that clearing Joomla’s cache will not really clear the cache, since that cache is technically handled by APC. Just to prove our point, we did a change to the module and waited 15 minutes, and when the 15 minutes elapsed, that change took effect on the frontend!

OK, so you’ve probably guessed by now what we did to solve the problem. We 1) changed caching from progressive to conservative, 2) change the cache handler to File, and 3) told the customer that whenever they needed to make a change to that module they must clear the page cache.

So, what is the wisdom that was gained from tonight’s work? In our opinion, it’s that APC causes confusion, because content managers expect (and rightly so) for their changes to immediately appear on the website when they make them (or at least after deleting the cache). So while APC is faster than regular Joomla cache, it’s not that good of an option especially if module updates are frequent.

Now, if you’re reading this because you’re having caching issues on your website, and if you still don’t know how to solve them, then why not just contact us. We’re always available, our work is swift and efficient, and our rates are very reasonable!

Note: For those of you wondering how come we didn’t set the Caching field for that particular module to No caching, we did do that, but for some reason, the module was still cached (whether we were using APC or File as cache handlers)! Could that be a bug in Joomla 2.5?

No comments yet.

Leave a comment