How to increase joomla slow speed using browser cache

→ Are you a new visitor? Please visit the page guidance for new visitors ←

How to increase Joomla slow speed using the browser cache

As the name implies, I’m going to show you a nice way to increase joomla slow speed by adding browser cache to your website. I already said in my other articles, mainly how to fix prestashop slow load, by making use of the user browser cache. In joomla there is something I found strange that even if you have joomla cache enabled, it is adding the no-cache option to the Cache-Control header to each of your page request, making it hard to make use of the browser cache using .htaccess. So I looked this up a bit and I found that you can remove this header by commenting a simple piece of code from one of the joomla files. So without any delay, how to increase joomla slow speed by using the browser cache.

Editing the joomla file and removing the no-cache option from the Cache-Control header

To remove the no-cache header, you need to edit the file located at:

/[root]/libraries/joomla/environment/response.php

Look for a piece of code similar to the one bellow:

and comment out the code so that it will look like bellow:

This will remove the no-cache option from the Cache-Control header so that you can control it from within a .htaccess file.

Enable joomla cache and also enable joomla SEF rewrites

This can be easily acived by going to your Administrator section, Site menu and choose Global Configuration.

Here make sure on the SEO settings it looks like in the bellow image:

Joomla SEO Settings

Joomla SEO Settings

You need to enable:

  • Search Engine Friendly URLs
  • Use URL rewriting
  • Adds Suffix to URL

After doing this, make sure you rename the file htaccess.txt in your document root of your website to .htaccess so that rewrite rules will work. Make sure the first dot is there!

Next click on the System tab. Here on the cache settings choose

  • ON – Conservative cache

Joomla Cache Settings

Joomla Cache Settings


And click save to apply the settings.

Setting browser cache for joomla using .htaccess file

The bellow rules will add the Expires and Cache-Control headers so that you would cache the pages directly in your browser on first request serve them from browser on the second request.

Open the .htaccess file inside your document root of your website and add to the bottom of the file the following rules:

The result will be visible, make sure you adjust the expire timeout and max-age to the values you wish, personally I use a 60 seconds timeout, but you can choose any number as long as you know what you are doing.

Request an article ←