...and optimizing your server and database resources for Joomla
I recently went through the available extensions and best advice on the web for optimizing performance for Joomla 1.5 and put it to work on a couple of sites that needed improved load times. (It's all relevant to any other PHP/mySQL applications too.) Here are the best of the best methods, summarized in a handy checklist. Most of these tips apply to any other LAMP-based web application, especially other "CMS" software like Drupal and Wordpress--and vice versa. See this list of 13 Great WordPress Speed Tips and Tricks for Max Performance.
Benchmarks
- Set a good set of "before" benchmarks to see what you get "after" you try different optimization methods. Use tools like YSlow, WebWait.com, JoomlaPerformance.com, WebsiteOptimization.com, and direct monitoring of your server's HTTP response with Pingdom or Site24x7.
Core Configuration
- Turn on gzip page compression if it gives you a noticeable boost.
- Turn on page and module caching.
Templates
- Templates truly designed to be optimized for search engines are lightweight and load quickly, in addition to being standards compliant, tableless, source-ordered, and semantically valid. Anything else is slowing you down.
Extensions
- Turn off and uninstall what you don't use. There's a security benefit to this practice also since unused code can still be the source of a vulnerability that gets you cracked.
- Don't use what you don't need, and don't use poorly written code that unnecessarily burdens database resources.
- For static or seldom changed sites, use Content Static. (FAQ).
- For sites that do change, try Query Cache, ideally with a PHP code caching method like xCache or eAccelerator. (JED - FAQ) Although it's a bit old now and can be tough to get working on some hosting arrangements, Query Cache is worth a look. It caches your database queries, which will reduce the load on your server and increase your capacity for traffic. (It may decrease your load times, but usually it won't.) QCache is good to use in combination with the core page and module caching system. Just be sure not to set (in the site global configuration settings) the core Joomla database handler or cache to store the user sessions and page/module cache in the database. It's also recommended to store the query cache folder above the web (document) root for security reasons. Using mySQLi with xCache is reported as having the best results, but I've seen errors reported (and encountered them) when trying to use mySQLi with Query Cache, so you may run into problems with this setting.
- Compress, compact, and/or merge your Javascript and CSS files to make them as small as possible with simple plugins like CSSjsCompress, RokGzipper, or PHP Speedy, which has the most options of the three. Minify4Joomla is a component that looks promising buit is complex and not easy to set up. CSS/JS Cache (Maecia) is a similar story. jFinalizer has quite a lot of options and seems least likely to break my templates. The Webo Site Speedup component (also a Wordpress plugin and more options for other CMS apps) is the most comprehensive, all-in-one way to compress, compact, and minify, but you need to pay for the pricey, top-tier version to get all the available features. Whether that's worth it, I can't say since I haven't tested it, but the lower tier options are things you can do easily enough by other (free of charge) means, including the plugins I've already mentioned. Webo as of version 1.0.0 actually works for me on Joomla, which is good (previous versions were not so hot), but don't expect magic. It's tough to get Webo (or any optimizer) working on sites with a lot of scripts and CSS at work even if you halfway understand what you're doing. Webo and other plugins that use the same optimization methods tend to screw things up, and they can even slow a site down, so go slowly, take notes, and test the results. Note: If you're using a WYSIWYG editor and want to have your CSS (for typography and so forth) available to the editor, you will probably find this impossible if you compress, minify, or merge your CSS files. I'm sure there is a workaround, but I haven't discovered it yet.
- On Wordpress, WP Super Cache and WP Widget Cache are staples, but you may also want to take a look at W3 Total Cache, which caches and minifies everything, and it also does query caching. Use the Latency Tracker plugin to see how you're doing with the number and speed of queries per page.
- The Google AJAX Library plugin for Joomla lets you swap out your local JS, mootools, jQuery, Prototype, and SWF libraries for the corresponding library hosted by Google.
I find that Google AJAX library + PHP Speedy or else jFinalizer work the best. They do the most for me and the least harm on more tricked out, CSS and script-laden sites using several different js libraries, sIFR, etc. Nevertheless, they seem to offer no significant performance gain with the core caching and page compression on. In fact, these extensions seem to slow my sites down in some cases.
Apache and mySQL
If you have access to your Apache and/or mySQL configuration:


Twitter
Myspace
Digg
Del.icio.us
StumbleUpon
Slashdot
Furl
Yahoo
Technorati
Googlize this
Facebook











0 Comments