Friday, July 4, 2008

Optimize Joomla - Lesson 1 by Greg Rickaby

 

During the next few days I will outline and highlight several ways to optimize Joomla. Let's face it, you are here because you Googled "optimize Joomla" and are looking for quick tips on how to make Joomla load fast for your viewers.

The advice I'm about to give is based on years of personal experience working on both ends of the spectrum - managing shared hosting servers with hundreds of Joomla websites, to actual design and maintenance of Joomla websites. To optimize Joomla, there are two ends of the spectrum:

* Server Side (Server Hardware) * Client Side (Joomla Core)

Joomla itself, comes in two applications:

1. Joomla 1.0+ 2. Joomla 1.5+

Since Joomla 1.5 is still very new, I will concentrate on how to optimize Joomla 1.0 AND since most of you are not Level 2 Hosting Technicians...I will write the first few pages of this lesson just for Client Side. As we advance through the tutorial, I will explain more in depth the how to optimize Server Side hardware.

Let's begin: Optimize the Client Side

Joomla was a fork of Mambo, (open-source content management system) which means someone was not completely happy with Mambo. Being open-source, you can take the source code and go do your own thing - a large group of folks did and alas, Joomla! was created. Since it was a fork, Joomla 1.0 still ran on Mambo's very un-efficient engine. To gain the desired speed results there are virtually unlimited ways to hack and tweak. I will not go to in-depth during the initial lesson because most of you again are just web designers, not server technicians.

Here are 4 ways to optimize your Joomla website in about 10 minutes:

1. Turn on GZIP compression 2. Enable Cache 3. Install PageCache 2.0 4. Disable any unnecessary mambots

Optimize Step One and Two: Turn on GZIP Compression and Enable Page Cache

Click "Site" --> "Global Configuration" --> "Server"

optimize

Check (or tick) the "Yes" button next to "GZIP Page Compression"

optimize

Next, while still in Global Configuration...

Click on the "Cache" Tab -->"Click "Yes".

optimize

Now click "Save" or "Apply"

optimize

Some will argue, (and they are right) that under certain circumstances, GZIP can actually slow your website down. This is true if:

1. You are on a shared host that still is running on a Pentium III while it dishes out thousands of other websites. (e.g.; Godaddy) 2. Your homepage is already clean and efficient with little code.

Q. How does GZIP compression work?

A. I'm not here to write a lesson on it, but in a nutshell...the server "zips up" the HTML code and text (not images) and sends them to your browser. Which then "unzips" the HTML code/text and continues to download images until finally your website is displayed. I stress: GZIP ONLY compresses code and text. For example, your homepage might have 200Kb of code...GZIP could compress that down to 20Kb!

Q. Why is this bad - and how could it slow down my Joomla website?

A. Compressing code requires the server processor and memory to perform extra steps (up to a factor of 4) before dishing out the page. Hence, if your on a shared server with an old Pentium III you'd see better results by leaving GZIP turned off.

Q. What is Cache, and how does it help me?

A. Do you have any Post-It notes on or around your desk? Most of us do, we write quick notes to help us remember something. Think of caching as a sticky note for the server. Rather than having to "remember" everything about the page, it takes a note for quick access later...thus making your website load faster.

Optimize Step Three: Install PageCache 2.0

PageCache 2.0 is a Joomla component that takes the stock page cache engine that is already in place and tricks it out. With many customizable features like file or database caching you can really optimize Joomla.

Download PageCache 2.0 Component

Install PageCache 2.0 "Installers" --> "Component" --> "Upload File & Install"

optimize

Navigate to: "Components --> "Page Cache" --> "Config" Now, enable PageCache 2.0 optimize

There is the option to cache either files or database. I choose file because my database is small, but my pages are full of code and other scripts. Yours might be different, but choose which one is right for you. Once you've enabled PageCache 2.0, you visit your site and caching will begin on the server side.

The proof is in the pudding! One of my sites gets around 500 unique users a day. With PageCache 2.0 turned on the page loads, on average, a .5-1 second(s) faster than with it turned off. This may not seem like much, but it adds up. Over the last 15 days I've saved over 26 minutes for my users - very impressive! (See Image Below)

optimize

Optimize Step Four: Disable any non-essential mambots

Mambots are scripts that enable components, like PageCache 2.0, to operate. Each time you reload any Joomla page it requires each mambot (or script) to run on the server side. By disabling unused mambots you are giving Joomla one thing less to-do each time a page is loaded.

You can see from the image below a few that I have turned off. Be careful! Turning off certain mambots will cause your site to stop working! Just do it one by one until you find a happy medium.

optimize

That is it for today's lesson: "Optimize Joomla in 10 minutes or less", I will continue this tomorrow with more technical detail. I hope you found this useful, now get to it and optimize your Joomla website!

About the Author

Greg Rickaby has 10 years web design experience and has spent the last 3 years working exclusively with both Joomla! and Wordpress. He currently is a website consultant and freelance designer.

No comments: