Ticker

6/recent/ticker-posts

Ad Code

Responsive Advertisement

How to Speed up Joomla 4 with Caching

Introduction

When it comes to performance, page speed is paramount. Since the advent of Google’s Mobilegeddon, page load time has been a hot topic for website improvement and a primary ranking factor, not only because of increased demand from mobile visitors but also because of potential lead and customer losses. Your website needs to be fast enough for your visitors as it’s the one that your website visitors will appreciate. Having fast page load time definitely enriches the user experience. That said, if your website does not load quickly, chances are you will lose site visitors to your competition in a matter of seconds.

And so page load time matters!!

But wait, what exactly does caching in Joomla have to do with this, and will enabling cache help improve page load time? Yes, absolutely! There are many ways to speed up a Joomla website, but caching is by far the best method actually. So…

What is a cache?

According to Wikipedia:

In computing, a cache is a hardware or software component that stores data so that future requests for that data can be served faster; the data stored in a cache might be the result of an earlier computation or a copy of data stored elsewhere. A cache hit occurs when the requested data can be found in a cache, while a cache miss occurs when it cannot. Cache hits are served by reading data from the cache, which is faster than recomputing a result or reading from a slower data store; thus, the more requests that can be served from the cache, the faster the system performs.

Caching in Joomla is actually a smart way of showing visitors the pre-loaded copy of your data. When a visitor accesses your website, Joomla temporarily fetches all the data from the database such as menus, components, modules, template files as well as dynamic content, and stores them to a set of local files (in the Joomla cache directory).

When the Joomla cache is in use, instead of hitting the database over and over again, subsequent hits will retrieve the content from these files, instead of from the database.

And because reading data from a local file is many times faster than from a database, the whole website will be loaded almost instantly and will perform much better. Your website will feel faster and be able to support more simultaneous users.

In this guide, I’ll walk you through how to enable caching and understand the different types of cache configurations in Joomla 4.

Speed up Joomla 4 with caching

Caching is a function implemented in the Joomla core. Therefore, enabling the Joomla cache is very simple and straightforward. Caching is disabled by default.

How to enable cache in Joomla 4

From the admin panel (or Home Dashboard) in the backend of your Joomla site, navigate to System > Global Configuration:

Joomla 4 - Caching - Access Global Configuration

On the System tab, under Cache, you will see a drop-down called System Cache, which is currently the only option.

Joomla 4 - Caching - System Cache

Click on the drop-down to see its caching options.

Joomla 4 - Caching - Select a Caching

You’re gonna get to select the type of cache you would like to use: Conservative or Progressive.

Conservative caching – allows you to select modules that will be cached. This option is better for dynamic sites where files are frequently updated since you have the ability to remove caching from sections of the site that are continually being updated.

Progressive caching – all unique modules are cached; affects all modules and overrides cache settings within each module. This option is recommended for static sites where updates do not frequently happen – to minimize the effect on static modules. Not appropriate/ not recommended for extremely large sites.

Generally, I would recommend choosing Conservative caching so that we can maintain the ability to decide not to cache specific modules.

With either option enabled, you have a few more cache settings configurations as follows:

Joomla 4 - Caching - Cache Configuration

Understanding cache configurations

Cache Handler

This is the mechanism Joomla uses to create cache. By default, the native caching mechanism is file-based (File), but you can choose a different cache option if you are an expert in using different cache handlers. Otherwise, it’s a complex process.

Platform Specific Caching

Enable or disable platform-specific caching, which means you’ll have specific different caches for different devices. Keep it to No if you’re having only the desktop version of your site. (Default disabled)

Joomla 4 - Caching - Platform Specific Caching

However, don’t confuse it with site responsiveness. Your site will still be responsive with or without caching.

Cache Time

Cache time (in minutes) is the required time the cached version of any page will remain valid and will be served to the visitors before it gets refreshed. If your site is dynamic and gets updated frequently, then you should set a lower cache time. And in the case of static websites, you can set this to a larger number.

The default cache time is 15 which means the cached version of your page or module will change every 15 minutes.

Path to Cache Folder

Joomla 4 - Caching - Path to Cache Folder

Specify a writable folder to store cache files if you do not wish to use the default one.

Clear or Flush the Joomla Cache

When you’ve enabled the Joomla cache, the content on the front-end of your site will not refresh until the caching time expires according to your settings.

So what do you do if you want to reset the cache right away?

Simply navigate to System > Clear Cache.

Joomla 4 - Caching - Clear Cache

Here, select the type of cache you want to delete. This will flush only specific parts of the cache. Or you can hit Delete All to flush the whole Joomla cache and refresh the content.

Alternatively, you can also purge the expired cache. Click the Clear Expired Cache button to purge all expired cache files. Note that cache files that are still current will not be deleted.

And well, that’s how simple caching mechanism is in Joomla 4!

Conclusion

Caching can be a huge improvement to the performance of your website. So, using the described options above, you can easily set up the cache for your Joomla website to make your site faster than ever before. Hope you enjoyed this article. Meanwhile, don’t hesitate to share your thoughts with us in the Comments section below.

Thanks for reading, and stay tuned for more how-tos!

The post How to Speed up Joomla 4 with Caching appeared first on LTHEME.

Enregistrer un commentaire

0 Commentaires