Saturday, January 24, 2009

Using SmartOptimizer with Joomla

Hey,

If you are having the Joomla site, and especially community driven then the thing you most care about is performance of site. But As far as I can think all joomla site performs poor.

I started a website with JomSocial... its a really good product. My target was to boost performance, and sharing my experience here.

Issues :
  1. JomSocial is on my frontpage - it have a lot of JS and CSS files to display
  2. My Template also have 3-4 CSS and 2-3 JS
  3. Then few other CSS and JS due to mod_signallogin, some other handy modules ...
Before optimization my grading of site was 33 in YSlow.
So I used smartoptimizer -
It can do a lot of things - Minify, GZip, CSS Embeddeing, Caching, Concatenation and many more.

I used in a new style, which was not mentioned anywhere, Why ?
  1. Firstly I installed as per adviced all over the net, But it reduced my performance as It accepts all type of files (php, image, ad html) ... so for these files smartoptimizer wastes my CPU power.
  2. Second issue was - I want to skip selected JS/CSS/Images ...
  3. I want to improve the performance of FrontEnd, but I do not want to impact my backend.

My Style of Implementation
  1. My Site is installed at http://mydomain.com
  2. I created a subdomain http://s.mydomain.com
  3. I created this structure at my subdomain -
    ---- .htaccess (Provided by smartoptimize)
    ---- index.html (A blank file)
    ---- SmartOptimizer Folder
    ---- x (A Folder with permission 750)
    |------x ( A linux style soft link to my main site folder, internal path)
  4. This is all for smart optimizer
Now I created a new renderer for head rendering, By new renderer, I achieved these things.
  1. Rewrite all JS/CSS links as http://s.mydomain.com/.... path-to-js
  2. Concat all JS files, http://s.mydomain.com/....path-to-folder/file1.js,file2.js,file3.js etc
  3. Concat all CSS files, http://s.mydomain.com/....path-to-folder/file1.css,file2.css,file3.css
  4. I didn't changed the functionality for CutomTags, So all the scripts added by CustomTag are still delivered from normal-site.
Benefits with my strategy -
  1. By new rendering, I can concat fils without modifying code.
  2. Most of the java-script required for no-conflicts are added thorugh custom-tags, so I don't mess-up those files, which must not be.
  3. I have shifted all my static content to subdomain, It helps my site speed at browser-side.
    (rendering in browser is faster, check yslow documentation)
  4. The optimization can be shifted to some other server, as its on subdomain :-)
(My site on YSlow is now at 78)
not better than this beacuse I server a lot of images on my homepage.

If you want to apply this appoach on your site, let me know. I will provided relavent code and help to set it up.
If you want me to help you in your site performance, conatct me.
- Shyam

4 comments:

  1. This is good Shyam. Once my site J!-JS is online I'll give this a go. Am running PhpNuke and despite all its faults, it fast. Now playing around Joomla, combine that JomSocial and other components/modules/plugins, the test server which only "sees" me most of the time is already crawling like a tortoise!

    ReplyDelete
  2. Hi,

    Thanks for very good informative post. I have a website developed in Joomla Development Platform. I get very nice information to boost up my website's performance from your post.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Used through many search engines, you can advertise a text ad and when a prospect clicks on your ad; your account will be debited by an agreed amount. This amount will vary, depending on the popularity of the keywords that you choose for your campaign. This is an excellent way to attract warm prospects to your Business web site, but can be expensive if you don’t watch your campaigns.

    ReplyDelete