Caching in Joomla

Joomla uses cache as a feature to speed up web pages. However, it is often misunderstood. Wrong cache settings lead to several issues, particularly for online stores that deal with dynamic content on every page.

What is Caching?

In simple terms, caching is like photocopying your web pages when they load  for the first time and then render the photocopy instead of the original page.

In broader terms, Joomla glossary defines Caching as: "The mechanism that offers users a stored view of (part of) a web page so that does not have to be pulled from the database. Joomla core offers three levels of caching: Page caching, View caching, and Module caching. By default, Joomla does not cache any content. When caching is switched on, the stored views for this are stored in the filesystem for Joomla ../cache/page/ folder.”



Page Caching

Before you rush to enable the System - Cache plugin, b please read the following instructions.

Page caching is where Joomla takes a copy of the whole page when it is first displayed.

"It takes snapshots of entire pages including everything - component, modules, plugins and a template. It is the fastest, the widest and the least flexible approach of all caching options" sasy Klas Berlič. You can read more with examples and images in this post by Klas.

When you use a shopping cart, your product pages have a dynamic content. For every visitor, product-pages render different content.

Take, Pricing, for example. In J2Store, you can set different price for different user (customer) groups.

Example: Leather Boots is a product that has a price of USD $25 for a retailer. However, it costs USD $20 for a wholesale customer.

Assume that you have the Page Caching enabled. When a retailer visits Leather Boots page, Joomla takes a copy and saves it. So when a wholesale customer visits the product, he sees the same page as the retailer. Moreover, it has the wrong price (USD 25).

So it is better to have the System - Cache plugin turned OFF when your site deals with a dynamic content.

View caching

View caching is controlled by the cache setting in the Global Configuration.

1. Conservative Caching

Conservative Caching is similar to the Page caching, but you have the option to set a lifetime for a cached content. After a lifetime, Joomla refreshes the cache. Nevertheless, it delivers the same content to all users till the cache is refreshed.

This setting again acts the same way as the Page Caching. However, it allows extensions to manage. J2Store's dynamic pages will not have any issues when you have the conservative caching enabled.

IMPORTANT NOTE: If you use Conservative caching, please exclude the J2Store Cart module from caching as it handles dynamic content. In Module settings -> Advanced - > set Caching to No Caching.  (Thank you Jay C Burton for pointing this out)  


2. Progressive Caching (Not recommended)

This caches the content for each unique visitor. For sites that handle a large number of visitors, this may not be the good option. Because, caching per visitor affects performance. For a smaller site, this is a faster method

IMPORTANT NOTE: Progressive Caching will override module-specific cache settings.

Module Cache

One should enable module cache for modules with static content only and then it works well with conservative caching. Modules with dynamic content such as J2Store Cart should not be cached.

Subscribe to get updates from us