12

Joomla! have a 3 different way for caching:

  • "Conservative caching" (in global configuration)
  • "Progressive caching" (in global configuration)
  • plugin "System - Cache"

I have the following questions:

  • What are the differences?
  • When do I use which option?
  • Should I enable the cache plugin when I already turned on the option in the configuration?
  • What proper way to configure default cache system?
5

In addition to Shyam's answer...

In Global Configuration -> Cache...

  • Conservative caching is a cache generated for each view of a component / module
  • Progressive caching is a cache generated for each view of a component / module on an individual per-user basis

This is an extension-level cache of views. It must be implemented by the extension developer to have any effect.

Note: logged in users will never see cached content via these means.

You can override individual module caching if 'Conservative caching' is enabled by disabling caching in the module's advanced options. You CANNOT override module caching on a per module basis if 'Progressive caching' is set.

The System - Cache plugin generates page caches of each whole page in /cache.

For most scenarios, enabling the System - Cache plugin is sufficient. If you only want to cache particular modules / components (which have caching implemented), disable the plugin and enable Conservative caching in the global configuration. You can then set exceptions by disabling caching in a module's advanced options.

Note that any caching is a balance between time and space - full page caching will reduce DB load and hence page load times, but will increase disk space usage.

You can find further analysis and benchmarks of the caching system here, as well as the Joomla Cache docs for admins and this excellent article detailing the various options and applicable caveats.

  • But I use progressive cache and it respects the module cache settings, so I think you should try that and correct your answer. – jackJoe Apr 25 '14 at 10:41
  • Are you sure? Every site I've reviewed states Progressive caching will override any module-level settings (particularly the 3rd table under 'Raw Results' on inmotionhosting.com/support/edu/joomla-25/caching/…). I will try and test this on a clean install today to verify one way or the other. – codinghands Apr 25 '14 at 10:44
  • 1
    about: "Conservative caching plus enabling the System - Cache plugin is sufficient" - whether this have a real sense? because as you explained: the Plugin do cache for whole page, so (as I understand) in this case Joomla! do not run a extension and so Conservative caching .. or I understand something wrong? – Fedik Apr 25 '14 at 11:02
  • 1
    I just tried it and in some situations it works and others it doesn't! if you include the module into an article (ex: by its position) it respects the no cache setting, but in a normal module position it ignores it! I would swear it worked for a normal module, but I just tried it again and it doesn't. – jackJoe Apr 25 '14 at 11:02
  • @Fedik You're quite right, a misunderstanding on my part. Now updated my answer. – codinghands Apr 25 '14 at 11:07
3
  1. Difference between caching -

    Conservative caching is the standard type of caching. Here’s how it works:

    A visitor visits a page on your website.

    • Joomla checks if there is a non-expired version of that page in its cache directory.
    • If the cached page exists (and it’s not expired), then Joomla will serve it to the visitor
    • otherwise, a cached version of the page is created, and that cached version will be served to the visitor, and to every other consequent visitor, as long as it’s (by “it” we mean the page) not expired.

    The above scenario is typical and is how most developers implement caching.

    Progressive caching works the following way:

    • A visitor visits a page on your website.
    • Joomla checks if a cached version of that page exists for that visitor and it’s not yet expired.
    • If that cached page exists, then it’ll be served to the visitor, otherwise, Joomla will create the cached page for that specific visitor and then will serve it to him.
    • If another visitor (who has never been on that page) visits that page, then Joomla will not serve the cached page of the previous visitor, instead, it will create a cached version of that page specifically for that user, and then serves it to him.

    As you can see, progressive caching only offers a performance improvement

    • if the same visitor visits the same page within the lifetime of the cached version of the page.
    • In most scenarios, progressive caching results in a huge performance hit that is far worse than disabling cache, simply because for nearly every visit, Joomla has to process the request, create the cached version of the page, and then serve the page to the visitor (instead of just processing the request and serving the page in the scenario where cache is disabled).
    • Oh, and don’t forget about all the cache files generated by Joomla – you can only imagine how many of these files you will have in your cache folder if you have a high traffic news website (that has many pages).

    Now you might wonder, under which circumstances is progressive caching useful? Well, imagine that you have a video website (similar to youtube). You want to show each visitor customized pages based on his location and/or browser settings and/or plugins installed. So, for every page that the visitors loads, you use this information to generate a customized version of that page and you cache it. If the visitor visits that same page again, then Joomla doesn’t need to redo the work to generate the customized page.

    Of course, there are many scenarios under which progressive caching is really useful, but in our opinion, progressive caching should only be considered if the website receives many visitors and if those visitors are mostly repeat visitors. Using it in other cases will cause a significant hit on the website’s performance. Ref:Read Joomla Caching in depth

  2. Conservative is recommended.

  3. Cache plugin provide complete page cache when enabled.
  • 3
    Could you edit this answer so the preformatted blocks are instead blockquotes? Also, please note the original source of this info (itoctopus.com/… and quoted in stackoverflow.com/questions/12739297/…). Furthermore, you recommend progressive caching even though this is mentioned in the article as only for very specific use cases...? – codinghands Apr 25 '14 at 10:20
  • not very clear, you said that: Conservative/Progressive "checks if a cached version of that page exists" and about plugin "Cache plugin provide complete page cache" .. so all these options and the plugin do caching for whole page output or? – Fedik Apr 25 '14 at 10:43
  • ok, I see another answer ;) – Fedik Apr 25 '14 at 10:45
  • Updated answer#2 Changed to conservative. – Shyam Apr 25 '14 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.