Joomla caching - How to enable caching in your Joomla website?
One of the most important factors of a successful website is its loading speed. Analysts say that a large percentage of website’s visitors leave and not revisit if it delays to load for more than 10 seconds.
In order not to lose your visitors and potential customers you will have to reduce as much as possible the loading speed of your website.
In a Joomla website a great way to achieve a faster loading time of your website is to enable the caching feature.
Whenever a visitor arrives to your site, Joomla in order to present a the final result of a page to the visitor composes the page elements by pulling data from the database, loading the theme, loading modules and content. This process requires some time. This time greatly decreases by the caching functions of Joomla. The first time you run, the above procedure runs for a page and the result is stored.The next visitor gets the saved ready page as if it was a simple static HTML page.
That’s great! How do I enable this feature?
In order to enable Joomla caching for your website you will have to login to your Control Panel and then navigate to System > Global Configuration from the top menu.
There you will find the System tab and inside the Cache Settings options. You will see three available options about cache.
The first option is the most important and it enables the website caching. To do so you will have to set the Cache option to ON. You will have to choose from two ON options:
- ON - Conservative level: If you want to create the same copy of a page for all visitors. How does it work:
- A visitor visits a page on your website.
- Joomla checks if there is a version of this page in the cache directory that has not expired (ie has not passed the cache time that we have defined).
- Since it has not expired, then Joomla will serve it to the visitor. Otherwise it will create a new version copy of the page requested by the visitor and will serve it for every subsequent visitor each time they visit that page until it expires.
- ON - Progressive level (default): If you want to create a unique copy of a page for each visitor. How does it work:
- A visitor visits a page on your website.
- Joomla checks if there is a version of this page for that particular visitor in the cache directory that has not expired (ie has not passed the cache time that we have defined).
- Since it has not expired, then Joomla will serve it to the visitor. Otherwise it will create a new unique version of the page requested by the visitor and will only serve it to this particular visitor every time he visits that page and until it expires. If a new visitor visit that page Joomla will not serve the cached version of the previous visitor but will create a new unique one that will serve only to the new visitor.
Generally there are scenarios that progressive caching is very useful, but in our view, it should be used only on websites that receive many repeatable visits by the same visitors. Otherwise it will cause noticeable degradation of performance on your website, because of the multiple copies on the server, with no substantial benefit.
The second option is the Cache Handler and is about the way that the cached pages will be saved. It is recommended to leave the default File option.
The third option Cache time is the time, in minutes, that a cached page will be stored in the server before it is renewed.
- If your website is most of the time static then a long cache time is preferable.
- If your website is frequently updated with new content, then you should choose a shorter cache time in order the cached pages to be refreshed and replace the old content with the new.
Finally click the Save button at the top of the page to save your changes on your website.
There is only one step left and that is to enable the System – Cache plugin. You can do this by navigating to the Extensions > Plugin Manager category from the top menu.
There you will have to type the word cache in the search box in order to find the System – Cache plugin.
You will see the searched plugin in the results below. Pay attention to the indication in Status column to understand if it is disabled or not.
If you see a red X (✗) in the status column as the picture below, that means that the plugin is disabled and will need to click on it to activate it. Otherwise if you see a green check (✓) then the plugin is already enabled.
Congratulations you just enabled the Joomla caching function for your website!
Note: In order for the Joomla caching to work correctly the /cache folder in the root of the Joomla installation directory should be writable.