Are you wondering how to make your Joomla website faster? Well, there are many possibilities, but we would like now to introduce the one that does not require much effort. Leverage Joomla browser caching is often recommended by Google.
This method involves the re-use of files already existing at the user and not requiring a download again.
It does not require many changes, and it’s easy to make. Extending the cache lifetime results in the user saving the time usually required to download the same files each time they visit the site.
Increase browser cache by changing the .htaccess file
The whole process requires a modification in the .htaccess files which you can find in the root of your web site's hosting server. The file edition will allow setting the expiry time of images and CSS files by changing the expire headers.
How to do it? You need to access your hosting CPanel and using any text editor find the .htaccess file (it’s hidden - use the FTP tool like FileZilla), then add the following content (set caching parameters) at the bottom of the file. That’s all. You can save the file (not as a .txt file).
Expires headers inform the browser whether they should request a specific file from the server or grab it directly from the browser's cache.
So in practice, they do not improve page speed for a first-time visit as this visitor would have to download all the files. But they significantly decrease load times for returning visitors. Expires headers can be set on specific file types.
You can set different expiry times. For these files that are often updated, it would be good to set earlier expiry date.
A tip - Set expiry at a minimum of one month and no more than a year ( it depends on you). Files should refresh as quickly as the HTML of the website.
Set short expiry times for things that change regularly. If your website visitor comes again within a month, he does not have to need to download your CSS and JS files again. Files that take the most time to download are kept on the visitor's machine.
Remember that enabling browser caching and setting up the parameters for too long might affect on the lack of a fresh version of your website after any updates.
If entering the code itself does not give results, it is worth to perform additional activities such as "enable optimization in the template parameters.
Learn more about ways to speed up, optimize your website.