Optimize Loading Joomla! site

E-mail Print PDF

Improve performance of your Joomla! website

I have been experiencing slower and slower loading time over the last several months. Mainly because of an increase in the number of visitors, but as well because I have added several interesting Joomla Extensions such as Tweetme and sh404SEF, two great tools. The former I added for better promotion of our website, the latter for better SEF urls. So, because of these changes the loading time has slowed down and has become more important. People do not like to wait.

Yslow

So I decided to uyse Yslow on this website to see what could be done. Yslow is  a great permormance checkup tool that works together with the Firefox Add on Firebug. It has been developed by Yahoo. As I received a grade E there was obviously a lot to do. Most websites like mine - are slow because the load many different CSS and Javascripts and have many images that are used. And like most websites .htaccess has not been optimized to tell browsers what files need to be loaded again and when that should occur. So many http requests are unnecessary.

How to improve?

 

There are two excellent ways to improve your site's loading speed:

  • Add / activate gzip for certain files and add Header expire for files in .htaccess
  • Compress css and JavaScript using the excellent CssJsCompress plugin

.htaccess improvements

#### Optimization
#
# Gzip the necessary files
#
<IfModule mod_gzip.c>
mod_gzip_on       Yes
mod_gzip_dechunk  Yes
mod_gzip_item_include file      \.(html?|txt|css|js|js?v=2|php|pl)$
mod_gzip_item_include handler   ^cgi-script$
mod_gzip_item_include mime      ^text/.*
mod_gzip_item_include mime      ^application/x-javascript.*
mod_gzip_item_exclude mime      ^image/.*
mod_gzip_item_include mime ^httpd/unix-directory$ 
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
#
#  EXPIRES HEADER
# turn on the module for this directory
ExpiresActive on
# set Default
ExpiresDefault "access plus 24 hours"
ExpiresByType image/jpg "access plus 1 months"
ExpiresByType image/gif "access plus 1 months"
ExpiresByType image/jpeg "access plus 1 months"
ExpiresByType image/png "access plus 1 months"
ExpiresByType text/css "access plus 1 months"
ExpiresByType text/javascript "access plus 1 months"
ExpiresByType application/javascript "access plus 1 months"
ExpiresByType application/x-shockwave-flash "access plus 1 months"
ExpiresByType image/ico "access plus 1 years"
ExpiresByType document/doc "access plus 1 months"
#
# Expire specific files
<FilesMatch "^(file.js.x)$">
 ExpiresActive on 
 ExpiresDefault "access plus 1 month"
</FilesMatch>

#
# KILL THEM ETAGS
FileETag none
#
###### End Optimization

The file specific addition you can remove unless certain files do not expire properly (check that in Yslow). Otherwise you can just remove it.

CssJsCompress plugin

This excellent plugin helps you to compress and merge most css and js files which significantly speeds up the loading of your Joomla! pages.  The major features of this plugin are:

  1. Css aggregation and optimization.
  2. Javascript aggregation.
  3. GZip aggregated Css and Javascript files. Only GZip one time, then load from cache next time.
  4. Client's side cache.

End result

B's and C's instead for all pages and a significant improvement in loading time on all pages of Imagewize. Bs and Cs are way better than Es and Ds I assure you!

NB Because I load several external files (3) from Google, Tweetmeme on the blog post pages Imagewize gets a lower grade for posts. We of course cannot add expiry dates to external headers so the former three files cannot be improved.Other reason for the C for all blog posts is that Jcomment loads a js with ? plus version number which somehow cannot get an expiry date. I do not know how to remedy this just yet.

Last Updated ( Sunday, 23 May 2010 13:58 )  

Add comment


Security code
Refresh

jTweet

Follow me on twitter
You are here: Home Joomla! Optimize Loading Joomla! site