Caching helps website response request quickly, in Joomla, there are several caching options available. What are they and how do the work together?
What is a cache?
Joomla cache stores all or part of a web page so that it doesn't have to be pulled from the database. By not needing to connect to the database, a website can respond much more quickly to a visitor.
Does caching help? Yes, absolutely! There are many ways to speed up a Joomla site, but we often see far better results from caching than anything else.
Option #1: Cache Settings
Go to System > Global Configuration > System. You'll see an area called Cache Settings with these three options:
- OFF - Caching disabled
- ON - Conservative caching
- ON - Progressive caching
Default explaining the difference between the two ON options.
- Conservative caching: Ssmall system cache, this allows a site administrator to choose which modules are cached. You can login to each module and enable for them individually. Conservative caching is better for frequently updated sites - you can remove caching from your modules that contain dynamic content.
- Progressive caching: Ffaster, bigger system cache, includes module renders cache. This takes a snapshot of each unique set of modules on a page, so many modules can be cached at once. This affects all modules and overrides any cache settings inside individual modules. Progressive caching is better for sites that don't update very often.
Here's an example of a module with cache settings. There are only these two choices:
- Use Global: cache this module if Progressive or Conservative caching are enabled.
- No caching: don't cache this module if Conservative caching is enabled.
Option #2: Cache Handler
Inside System > Global Configuration > System, there is a second option called "Cache Handler". This allows to move away from the default setting but this is harder to use. To use anything except the "File" option, you must have appropriate PHP extension installed.
Option #3: Cache Time
Inside System > Global Configuration > System, the third options is Cache Time. The more dynamic your site is, the lower this time should be.
For example, if you leave this setting to 15 minutes, your page will only appear to change every 15 minutes. If your site is updated more frequently, change this to a smaller time. If your site is rarely updated, you can set this to a larger number.
Option #4: Page Cache
To turn on the page cache, go to Extensions > Extension Manager and enable the System - Cache plugin.
In short, the page cache covers the whole page.
Note: there is one site effect of this, once you enable page cache, your page hits couter won't work correctly.
Option #5: Browser Cache
To turn on the browser cache, go to Extensions > Extension Manager and edit the System - Cache plugin. Set Use Browser Caching to Yes.
With browser caching, every time someone looks at a page or an image the browser keeps a copy of it. Then if you request that page again within a certain amount of time, rather than run out to the internet to grab a new copy, it just gives you the locally saved version. This make your site feel much faster.
Here's a video introduction to browser caching which includes some more advanced options: