Improving Your Joomla Site Performance

 Website speed has always been on top of our list on items to check before site launch because it makes or breaks user experience. A 3-second loading time already pose risks of losing a visitor and we simply can’t let that happen. Not to mention waste a very good layout and design because of crappy site performance.

Currently, our Joomla sites loading speed averages at 2 seconds but with web technologies constantly changing, we always need to keep up and develop more ways to improve site performance.

Here we have compiled a list of methods that worked for us and we believe can also help you somehow.

Enable Compression

As the name itself suggests, enabling compression will result in faster loading time because this feature compresses a page visited before it is transferred and downloaded. To enable, follow the steps:

Login to your admin and go to System > Global Configuration. Click on Server tab then on GZip Page Compression option change the preference to Yes and Save your changes.

We always make sure our sites are optimized for faster page loading and conduct a test before launching. We check the status of our gzip compression using an online tool Just enter the URL of the site you like to check, click on the blue button and wait for the result.

If successful, the result shows something like below. It will also include a comparison of your site’s compressed and uncompressed sizes and other technical details.

Enable Cache

Cache improves site speed by temporarily storing a copy of your page or other web documents and uses the copied data when subsequent visitors go to the site. It reduces bandwidth usage and server load because retrieving of data wouldn’t need to be downloaded directly from server.

You can also use reverse proxy caching with Varnish but we’ll get to more of that later on.

To configure caching in Joomla admin go to System > Global Configuration. On System tab, locate Cache label under Cache Settings and choose ON – Conservative caching option on the dropdown list. Click on Save & Close at the top left of the page.



.htaccess Optimization

Improving site speed with a few tweaks in your .htaccess file is often overlooked but this method always works perfectly well. The items we are referring to here are ETags, Expires Headers and automatic compression.

To help optimize your site here are a few rules you can add at the end of the .htaccess file that will improve the performance of your Joomla site. Proceed with caution though, what works for us might not work for you. It’s best to review this first and do your own modifications based on what you need.

########## Begin - ETag Optimization

## This rule will create an ETag for files based only on the modification
## timestamp and their size. This works wonders if you are using rsync'ed
## servers, where the inode number of identical files differs.
## Note: It may cause problems on your server and you may need to remove it
FileETag MTime Size
########## End - ETag Optimization
########## Begin - Automatic compression of resources
# Compress text, html, javascript, css, xml, kudos to
# May kill access to your site for old versions of Internet Explorer
# The server needs to be compiled with mod_deflate otherwise it will send HTTP 500 Error.
# mod_deflate is not available on Apache 1.x series. Can only be used with Apache 2.x server.
# AddOutputFilterByType is now deprecated by Apache. Use mod_filter in the future.
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
########## Begin - Optimal default expiration time
## Note: this might cause problems and you might have to comment it out by
## placing a hash in front of this section's lines

# Enable expiration control
ExpiresActive On

# Default expiration: 1 hour after request
ExpiresDefault "now plus 1 hour"

# CSS and JS expiration: 1 week after request
ExpiresByType text/css "now plus 1 week"
ExpiresByType application/javascript "now plus 1 week"
ExpiresByType application/x-javascript "now plus 1 week"

# Image files expiration: 1 month after request
ExpiresByType image/bmp "now plus 1 month"
ExpiresByType image/gif "now plus 1 month"
ExpiresByType image/jpeg "now plus 1 month"
ExpiresByType image/jp2 "now plus 1 month"
ExpiresByType image/pipeg "now plus 1 month"
ExpiresByType image/png "now plus 1 month"
ExpiresByType image/svg+xml "now plus 1 month"
ExpiresByType image/tiff "now plus 1 month"
ExpiresByType image/ "now plus 1 month"
ExpiresByType image/x-icon "now plus 1 month"
ExpiresByType image/ico "now plus 1 month"
ExpiresByType image/icon "now plus 1 month"
ExpiresByType text/ico "now plus 1 month"
ExpiresByType application/ico "now plus 1 month"
ExpiresByType image/vnd.wap.wbmp "now plus 1 month"
ExpiresByType application/vnd.wap.wbxml "now plus 1 month"
ExpiresByType application/smil "now plus 1 month"

# Audio files expiration: 1 month after request
ExpiresByType audio/basic "now plus 1 month"
ExpiresByType audio/mid "now plus 1 month"
ExpiresByType audio/midi "now plus 1 month"
ExpiresByType audio/mpeg "now plus 1 month"
ExpiresByType audio/x-aiff "now plus 1 month"
ExpiresByType audio/x-mpegurl "now plus 1 month"
ExpiresByType audio/x-pn-realaudio "now plus 1 month"
ExpiresByType audio/x-wav "now plus 1 month"

# Movie files expiration: 1 month after request
ExpiresByType application/x-shockwave-flash "now plus 1 month"
ExpiresByType x-world/x-vrml "now plus 1 month"
ExpiresByType video/x-msvideo "now plus 1 month"
ExpiresByType video/mpeg "now plus 1 month"
ExpiresByType video/mp4 "now plus 1 month"
ExpiresByType video/quicktime "now plus 1 month"
ExpiresByType video/x-la-asf "now plus 1 month"
ExpiresByType video/x-ms-asf "now plus 1 month"

########## End - Optimal expiration time

RewriteRule ^templates\/your_template_folder/ - [L]
## I found this necessary for @fontface fonts
RewriteRule ^templates\/your_template_folder\/fonts/ - [L]
##Yoo Themes Widgetkit and Zoo will not display css styles or images
correctly if the cache folder access is blocked
RewriteRule ^cache\/widgetkit/ - [L]
RewriteRule ^cache\/com_zoo/ - [L]
RewriteRule ^cache\/com_templates/ - [L]
RewriteRule ^cache\/template/ - [L]
RewriteRule ^cache\/plg_jch_optimize/ - [L]

As I have mentioned earlier we also use reverse proxy caching with Varnish and CloudFlare CDN that were published as separate entries. Read more about it here:

SiteGround’s SuperCacher with Varnish
CloudFlare CDN

These are just a few in a lot of other ways to improve your Joomla site speed. If you want to optimize and do the same for your Magento site check out our post here.