We've been hearing for a while that SEO and Joomla SEO may be affected by the time your page takes to load - so recently we've started an intensive exercise of getting our website to load in the absolute minimum time possible.
Our belief is that the current load speed and rating in GTMetrix is relatively good 85% for PageSpeed, and 95% for YSlow Grade and a load time of 1.29seconds, so we thought we'd share how we did this. Some of these are Joomla specific, whilst others are generic but the general concepts apply to ANY content management system and any website.
Before you begin: Run your website through GTMetrix, or Pingdom Tools. Take note of your current grade and then watch it improve. The good thing is that GTMetrix tracks your history too so you can see a graph with your improvements.
STEP 0: TAKE FULL BACKUPS - Some of the following recommendations may break your site. Take frequent full backups before making any changes.
1. Reduce Server Response Time
If after running your website through GTMetrix or PageInsights you find a long delay in the initial response - your shared hosting server is suffering.
The biggest difference you can make to your website loading fast is to use a recommended Joomla host and improve the server response time. Our recommend hosting service is InMotion, which is what we use on this website.
We run this site on an InMotion VPS-3000HA-S plan running a LiteSpeed server, an Enterprise level web server that is proven to be faster than Apache, or NGINX. Thanks to such a setup, our server response time is typically less than 0.1 seconds.
Check out the screenshot below, you can see the 100ms initial response time.
As you can imagine, this is a highly tuned setup, with multiple levels of caching, including PHP OpCode caching (which makes PHP run faster), so this is not your typical shared hosting setup.
But if you're serious about speed, a VPS is definitely your first port of call.
If you want a VPS at a good price, we've partnered with InMotion hosting to give you up to 70% OFF on VPS pricing, check out our offer below.
2. Set yourself an ambitious target and fixate on it until you get it
This is an absolute must.
If you don't have a target, then you're unlikely to keep pushing.
You must set yourself an ambitious target and strive to achieve it BEFORE you start optimizing. For us, our target was to reduce the load time of the frontpage to less than 1.5seconds AND get at least 85% on both Pagespeed and YSlow score on GTMetrix.
Our end result. Load time of just over 0.5 seconds.
Not too shabby :)
3. Enable the default Joomla Cache
This is pretty simple however it is VERY effective.
Mostly this is because rather than running the same queries over and over again against your database, the cache stores a copy of your page and serves it from a temporary file that is stored on disk.
This eases the load on your server and improves the general load time of your server. Database queries, particularly on shared hosting services could take a fairly long time to execute, especially as the items in your database grows. If your traffic is also growing, this means that your server and database is constantly under heavy load.
Caching fixes this by eliminating most of the load. The data your website requires is created periodically and stored on a cache (i.e. stored in a file on the server). Retrieving the page / data from disk, instead of running the queries from the database makes the loading time MUCH faster.
To enable your cache do the following:
System > Global Configuration > System
Switch Progressive Caching On, and set the cache expiry to 60 minutes (or more) especially if your content doesn't change too often. You don't need Platform Specific caching. This would create different versions of the cache for mobile / desktop users, unless you have significant mobile and desktop users.
You could set it to much longer if your content changes infrequently, you could see this to 240 minutes, or even more, especially if you get a lot of visitors on the same pages.
4. Enable GZIP Compression
This step ensures that the content you generate is compressed before it is sent. The logic is very simple, it takes much less time to compress and decompress content rather than transferring large pieces of content. This is something which can also be done easily in Joomla 3 with the following:
System > Global Configuration > Server
Switch GZIP compression to YES.
(If you are looking for a full document on how to enable GZip compression on WordPress, please refer to this article on CollectiveRay)
5. Enable the System - Cache plugin
This plugin caches each whole page on your site and (optionally) recommends to your browser and this page should be cached for some time (this is known as browser caching).
The first part of this step ensures that ALL pages are cached at the server. This is quite important, because otherwise, while generic stuff such as menus would be served from the cache, each page would still have to be served dynamically.
That's why we switch on this plugin to enable caching at the page level.
Browser cache makes a lot of sense especially because you won't need to redownload certain images and files over and over again. The browser will use the local copy and thus less data transfer is required and hence your pages load faster.
This is especially effective for stuff such as the CSS and images of your stylesheet. This is also standard Joomla functionality enabled via the following:
Extensions > Plugin Manager, search for Cache and enable the System - Cache plugin. You can also exclude certain menu items that need to be uncached, or go to the Advanced Options of the plugin and exclude specific URLs that you'd want to remain uncached.
6. Leverage Browser Caching at the server level
This is very similar to Step 5 when it comes to the browser caching part. This specific step is strictly related to Browser caching.
The difference is that this step is now done at the server level. Basically, you'll need to recommend to the Browser to cache certain files types for a specific amount of time. Google PageSpeed suggests at least ONE MONTH.
To do this, you will need to edit the .htaccess file to the following. The max age value is 1 month in seconds.
Header set Cache-Control "max-age=2592000, public"
Other values you might want to consider:
Header set Cache-Control "max-age=29030400, public"
Header set Cache-Control "max-age=604800, public"
You might also choose to cache less or more file types, but the above are the most common static files which can and should be cached.
For those of you working with WordPress, we've created an extensive guide on how to do leverage browser caching with or without a plugin on this guide on CollectiveRay.
JCH Optimizer contains a HUGE number of recommended stuff by PageSpeed and results in a huge boost in your PageSpeed grade.
The problem you might encounter is that this may break some of the functionality on your website. Tread carefully with the options you enable.
For our site, we managed to enable nearly all optimizations with very few exclusions - but for your site, you might have to play around for a while to find the optimal settings. Describing JCH Optimizer is a bit beyond the scope of this article, but take our word for it, install and enable the plugin. You won't regret it.
The following is part of the official description:
8. Reduce the content on your site
This is VERY important. Make and keep your site absolutely lean. This is the one which you should spend the most time on. We spent weeks on this step alone.
To do this, you need to take an axe at as many components, plugins, and modules as you can. Kill them. Kill them with fire.
Each piece of additional functionality increases server execution time and increases the total weight of the site.
NB: Tread carefully here. Take full backups before deleting core Joomla! components, modules and plugins
Do this with until you exhaust yourself. Really, do this. Remove ALL stuff that you are not using.
Even stuff which comes as default but which you won't be needing, such as
- the default template which you won't use ever again,
- the web links components which you are probably not using,
- the newsfeeds components if you are not using them,
- and ALL the plugins which you will never use.
Uninstall them, not just disable them.
Obsessively focus on stuff that you don't need, remove all the extra components, and combine modules and plugins if possible. E.g. for social buttons use 1 plugin for everything. If you have custom HTML, put as much of it into a single module as possible.
- Delete extra forum categories, and minify the number of items in your menus to the utmost necessary.
- Delete old users and old content.
- Merge and combine sections, categories, menus, and anything else as necessary.
Your focus should be to get things down to an absolute minimum required for your site to exist. Do this obsessively for a number of weeks. Go on a deletion spree, chop and remove, disable and uninstall.
Focus on making your site as lean as humanly possible without breaking anything.
Unfortunately, we did not keep track of the stuff we removed.
9. Reduce the total number of requests
Remove extra images that are superfluous.
Also, download and host a version of any images which are served from external websites from a copy on your site (this will reduce the number of DNS lookups that your client's browser will need to perform since these have a severe impact on the page speed of your site).
Analyze in detail what the requests are with GTMetrix or Pingdom performance tools. Then see whether these requests are truly necessary. If they aren't remove them.
For example, that 3rd party script you installed a couple of years ago? Do you still need that? And that Google AdSense script, is it really necessary? Are you still using the Facebook pixel or can you remove it?
We tend to go wild with third-party scripts, we get shiny object syndrome and add to our site, not realising that we are bloating the size of our site.
So do the same as the previous step. Study each request that your site is sending, see whether it is necessary and if not kill it.
GTMetrix also has a cool feature that will optimize the size of all your images. Save the versions which have been optimized and use the optimized versions in your website.
10. Serve content from a CDN
Content Delivery Networks are servers that cache a copy of the static parts of your site and can serve it optimally and much faster than your server ever could to your visitors. This will give you another HUGE boost to your page speed.
StackPath starts at $20/month.
While that may look like a lot of money, especially compared to such stuff as your website hosting, if your site is faster, the UX is better and you're bound to get more organic traffic and boost your website's business overall.
11. Follow each recommendation on PageSpeed, YSlow
Both PageSpeed and YSlow have a number of detailed recommendations, such as specifying
- a default character set
- ensure you have specified image dimensions (specify the width and height for each image on your website).
For any content which is hosted on your site, follow each of these to the letter.
If you have no clue what you need to do, Google is your friend, read about it and understand it and action it on your website. Avoid bad requests, i.e. make sure there are no images or files which are incorrectly linked.
Some can be quite difficult to do unless you really know what you are doing. Load 3rd party scripts such as Facebook, Twitter, AdSense, and Google Analytics asynchronously. There are many fairly easy optimizations that you can do.
PS. There might be recommendations that you cannot follow for content that is hosted outside of your control. E.g. AdSense, Facebook, and other scripts all have some optimizations they can make. You don't have much control over these. The good thing is that your CDN might also have optimizations for 3rd party content too. If not, don't worry too much about them.
If you keep iterating with optimizations, you should eventually arrive at a point where your site becomes lightning fast.
Conclusion: Why do you need to make your website faster?
Really and truly, if you are using your website to improve your business through sales or otherwise, a slow site is literally burning a hole in your pocket.
Users are quite impatient and will abandon your site if it's not snappy enough. You will also, of course, send a very negative unconscious signal to your visitors. Here are all the negative effects
- Customer satisfaction decreases by 16% if there is a one-second delay in page response
- 47% of users expect a site to load within 2 seconds and will abandon the site if it takes longer than 3 seconds to load
- 50% of users aren't loyal to sites which load slowly
Have you achieved good results with the above recommendations? Share your experience with us in the comments below!
How to make your website faster - a final thought
We're hosted on InMotion because we care about our website being really really fast, and we're recommending them because we truly think everybody should too - it will give your website an instant boost.
Besides loading faster, their servers are safer and their support is better (they do have to metrics to prove these bold claims). Why don't you do like us and give InMotion a try.
You won't have to worry about moving your site, they will do it for you for free. We guarantee you'll never want to go back to your old host. You have a 90-day money-back guarantee, so you don't even have to pay them a cent if you don't like what you see ;)
Please leave a useful comment with your thoughts, then share this on your Facebook group(s) who would find this useful and let's reap the benefits together. Thank you for sharing and being nice!