11 Useful Tips to Speed Up Your Joomla Website
A fast Joomla website is essential, no one wants to wait for content loading; people need everything immediately. Also speed is an important factor in Google’s eyes, when it compiles the Search Result Pages (SERPs), speed is considering as a key factor.
1. Everything Starts at Your Hosting Provider
Are you using free hosting providers? Free providers offer you limited server resources, so your website is displayed slower. Also they often add adverts to your pages automatically, that slows down the site load and decreases the performance.
There are many shared hosting providers on the internet; you can find hundreds of thousands of them. Find a good provider by reading reviews or forum entries. There are plans only for a few dollars a month!
Also, if you don’t use free providers, you can check your current plan. Is its speed good enough? Are there negative reviews about your hosting company? Google the company name and also perform a few speed tests on your website. To do the latter, type website speed test keyword into your browser and try the first few testers.
If you don’t have the time to do the research, rely on reputed websites, who already researched the best cheap Joomla hosting providers and published their results online.
2. Use Cache to Speed Up Joomla
At every website load, your visitor is served with the actual version of your website. This means that the scripts and functions are running at the same time, data pieces are read out from the database and all of these steps need server resources and time.
Caching is a solution when the cache script makes a static image of your website, converting the scripts and functions into static html files and serving these files to visitors. With this solution the server resources are needed only when the script makes the static files. The cached content is updated on regular basis, so you can set how often the static files should be replaced with newer ones.
In Joomla, there are 3 types of cache: component views, module views and page views.
Component views and module views can be set in Global Configuration. You should find Cache Settings section and set Cache field to On – Conservative caching. The Cache Handler should remain File, while the Cache Time can be changed from the default 15 minutes to anything. The smaller minute amount you set, the more server resources will be needed.
Page views are not cached by default, but you can turn it on by switching on the System – Cache plugin in the Plugin Manager. You should set the plugin status to Enabled and use the Joomla default values.
There are other extensions as well, that can help you solve your cache related problems:
To get an extension for automatized cache purge, use NoNumber Cache Cleaner.
3. Use Gzip Compression
Your website has a size that contains all elements’ (e.g. texts, images, scripts, etc.) sizes and every time a visitor checks your website, this data amount should be transferred from your webserver to the visitor’s computer. The more data that is transferred the more time your website needs to load.
There is a method to decrease the data amount which is sent and it is called Gzip compression. This method compresses your website’s data into a zip file and sends it to the visitor’s browser. All of the modern browsers supports this feature; Internet Explorer since version 5.5 (July 2000), Mozilla Firefox since version 0.9.5 (October 2001) and Google Chrome always supported it.
By using Gzip compression you can compress your website data by up to 50% (or in extreme cases up to 90-95%) so in the most ideal case your website can be loaded in half time. To enable Gzip compression on your Joomla powered website, you should visit the Server tab in Global Configuration and set YES for Gzip Page Compression.
You can check if Gzip compression is working on your website by using a Gzip compression test. This kind of test also shows the original and compressed data amount, plus the compression ratio. Varvy.com has a very good and easy tool so it is recommended to use it.
In case you enabled Gzip compression in Joomla but the tests show that it is not working on your website, you should ask your webhosting provider. It is possible that mod_gzip is not supported on your web storage or it is switched off. You can also ask the provider to switch it on for your website, or in the worst case scenario, you can always find a new provider that supports the enabled Gzip compression.
4. Check the extensions
In most cases, extensions need many resources and some time to load. The more extensions you use, the more time your website needs for loading. In order to improve your website’s speed you should check your extension usage.
First, check the list of your used extensions. Do you really need all of them? What are the most important extensions that are essential for your website to exist? Switch off all the extensions which are not crucial and your website speed will be improved.
There can be different scripts that need other scripts or data from stranger websites. For example, Facebook like buttons always connect to Facebook servers to get information about each content piece’s like numbers. These connections need some time and they can slow your websites down.
The same is true for Google Plus, Twitter, Pinterest and other social media networks’ counters and buttons. Google Analytics, Google Fonts, etc. also sends data to their providers’ servers and gets some of them back. These connections also need time and decrease your website’s performance. You should think on it which of these social media features are essential and which of them only slow your site down.
Sliders could also cause site problems, since in most cases they contain big images. Some sliders download all of the slides at site loading, and because of big data batches of big images, they can make your website’s loading speed super slow. If you don’t want to remove your slider, you should reduce the used images’ sizes in it.
To reduce your images, you should use resizing tools, there are a huge variety of them on the market. You can use these ones too, since they are all free:
- to resize JPG images, use jpegtran: http://jpegclub.org/jpegtran/
- to resize PNG images with losing image quality (lossy optimization), use pngquant: http://pngquant.org/
- to resize PNG images without losing image quality (lossless optimization), use optipng: http://optipng.sourceforge.net/
By using lossy or lossless optimization methods, your images will be smaller; the only difference between them is that lossless optimization will create relatively bigger and more optimized images.
Also, check if the used scripts are embed into the right place. For example, if you need a script only on your contact page, be sure that it is loaded only there and not on your other subpages too.
5. Set browser cache in .htaccess file
.htaccess file can be found in your root folder and it contains instructions for Apache web servers. You can add extended caching into this file in order to send less data to visitors. Of course, sending less data also means faster website load.
If your website operates with many images and they are static, you should set that the user browser does not download them again and again at every visit. This way only the new website elements will be downloaded and the already used elements will be served from user’s temporary folders.
To set caching in .htacess file, add these lines to your file:
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType etc, etc.
With this code piece you set a 30 day long caching for jpg and png files, 7 days for css files, etc.
6. Optimize the image serving (reduce image size)
As we have already mentioned it in Section 4, images give the biggest part of your website’s data amount. Similar to slider images, you should optimize all of the images which are used on your website.
We already mentioned jpegtran, pngquant and optipng in Section 4, but here are a few other tools you can use for image optimization:
- tinypng is a smart tool for png and jpg optimization, you can drag and drop up to 20 images: https://tinypng.com/
- PNGGauntlet is a downloadable tool for Windows, Mac and Linux and can be used for png files: https://pnggauntlet.com/
- RIOT is a free JPG optimizer available for Windows: http://luci.criosweb.ro/riot/
7. Use CSS image sprite
There is another method which can be used to fasten your website display; it is called CSS image sprite. It reduces the number of requests between the visitor’s browser and your webserver.
Normally, to show an image on a website, it needs a few actions. First, the user’s browser asks the webserver for the image. The webserver needs some time to find and send it to the user’s computer. If you have 100 images on your website, showing all of them requires 100 requests from the user’s browser and 100 answers from the webserver. All of these image servings need only a few milliseconds, but 100 times a small time period can stack up to a nice length.
To use CSS image sprite, simply put all of your images, icons, thumbnails, etc. on a big image. This way only 1 image should be downloaded by the user’s browser and this will reduce the time of website serving.
When you want to show an image on your website, you just simply need to tell the browser which area of the big image contains the desired small image. For example:
background-position: 0px 30px;
This CSS definition tells the browser that it should use allimages.png and display that particular part which starts at 100 pixels right and 20 pixels down from the upper left corner. From that starting point the desired image is 25 pixels wide and 25 pixels tall.
8. Use a CDN
CDN (Content Delivery Network) is an advanced way to serve visitors with websites and if your Joomla powered website targets users from around the World, it is recommended to use it.
When a visitor visits your website, the network detects his or her geographic location and serves him/her from the closest server. It is easy to understand that a North American visitor can be served faster from North America, rather than from Sydney, while an Australian visitor would prefer a closer Australian server, not one from Europe.
So, the CDN network serves the visitor faster, only your dynamic content, like HTML files are served from your default server.
You can add CDN extensions to your Joomla website by visiting the official Joomla extensions website. You should choose Core Enhancements -> Performance -> Content Networking path and explore the extensions.
There are three common extensions that you can try for sure, they are really recommended:
- CDN for Joomla, the basic version is free, the Pro costs $30: https://www.regularlabs.com/extensions/cdnforjoomla
- jomCDN, only paid version is available for $30: https://www.corephp.com/joomla-products/jomcdn
- JA Amazon S3 Component, only paid version is available for $35: https://www.joomlart.com/joomla/extensions/ja-amazon-s3
Load the scripts asynchronously – When your website is loaded, all functions are executed one by one and after each of them is executed, your website is shown to the visitor. This means if there is a script that needs more time, your whole website display is stopped while the script finishes the run. In some cases, web browsers don’t wait too long for scripts. They instead break the connection and show that the website is not available. To avoid such cases, run all scripts in asynchron mode. This means that your website will be displayed to visitors quickly, and scripts will be ran in the backend asynchronously. In case of a script error, your website will still be visible, only the broken scripts will be stopped in the backend.
10. Use speed optimization extensions
If you are not a programmer, web hosting expert or .htaccess file guru, there are Joomla extensions to speed up your website. Using them, you can easily apply tips and tricks that you have read above as well as in previous installments.
aeSecure is an advanced tool for using more secured .htaccess and php.ini files. With this utility you can switch options on or off in both files, so you can use as strict rules on your websites as you want. There is a free version of this utility with no support and there are 3 paid packages as well. With Premium you can get all premium features for EUR 20 per year. Premium+ already contains the support for EUR 50 per year, while Pro costs EUR 100/year and offers private support, unlimited usage and multisite installation as well. Read more about this tool and download it here.
11. Optimize Your Joomla Website for Mobile
Mobile versions are almost more important than desktop PC versions, Google penalizes those websites which do not have mobile version. It is vital to check your website with Google PageSpeed Tools and fix the upcoming mobile version issues. You can check you website’s performance here.
If you don’t have programs or don’t want to pay a lot of money for them, try Advanced Module Manager, it helps you in switching modules on your website’s mobile version on and off. It is available in free and paid versions. The Pro version comes with extra fields, chance to assign modules to seasons, months, days, time, user IDs, user’s country, region or state, contains advanced shop modules and PHP codes. It also give access to Pro forums. The Advanced Module Manager Pro version costs EUR 30 per year. You can download either the free and paid versions here.
Wrapping it all up
So these are the most effective ways to speed up your Joomla website. Probably there are other tricks too that I missed form this guide. If you know other ways for speeding up your Joomla site, please share your thought in the comments.
I really hope, this guide has helped you to improve the speed and performance of your website. If so, please share this tutorial on your social channels to help others too! Thanks!