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:


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.

  • M Nissen

    Fantastic, very very helpful.

    • I’m glad this was helpful for you!

  • Pablo Arias

    Good article, thank you! I don’t recommend to modify Joomla core files. Here you can see more tips:

    • Thanks for your reply, indeed, altering core files is not usually recommended, but if checked, you will notice that you can control your resources cache, but not the main page. That will always need to be downloaded and parsed by the web server and the header

      Cache-Control no-cache

      will always be there. I think joomla takes it that the pages (not website resources) do *not* need to be cached by the browser in any way.

  • Joe

    Add suffix to url? I don’t understand this. Will this really add the suffix or will adding the above to the .htaccess file take it out?

    • Yes, it will add suffix to your urls, that’s really done by joomla and rewrite takes it from there …

      • Joe

        Thanks for your reply. Is this necessary for this to work? My site has been online for a while, so that would change the url’s – which is not good for seo.

        • No, its not really a requirement, rather its just an option people fancy most …

          Just make sure the cache option is selected and you should be fine.

          • Joe

            O.k. thanks I’ll try it out.

Request an article ←