View RSS Feed

Brian Cummiskey

SpeedSEO - Make your site fly with Minify

Rate this Entry
by , 02-09-2011 at 01:13 AM (6319 Views)
You wrote great content. You're getting noticed in the search engines. But, your site still isn't quite 'there' yet. Getting the last bit out of your site to push it over the edge is always the hardest part. It's a bit like dieting. Losing the first few pounds (or kilos for you metric folks ) is easy. It's the next 5 that are hard, and the next 10 that are impossible.

vBSEO offers a ton of options to enhance your vB forum's SEO well beyond the core product. With the 3.6 series offering CDN integration, there's really only one more step to conquer on which vB forums fail miserably: javascript. Mounds and mounds of javascript.

One of my actual live forums' forumhome page. And this is AFTER this optimization was performed on it.
blogs/brian-cummiskey/attachments/8128-speedseo-make-your-site-fly-minify-breakdownpie.png

Javascript is the worst element in the page load waterfall. It loads one item at a time as it finds it in source, and then the browser 'compiles' it before moving on to the next line of html source. (I use the term compiles very loosely, but it's the basic concept at hand.) This delay can cause your pages to take a lot of time to load.

There are new methods popping up every day to load javascript asynchronously to aid in the page load. Unfortunately, this isn't always possible, as the js needs to be available to render the page.
It's fine to call Analytics or another tracker this way as it doesn't form the page. But, you can't put off loading your menu and everything else, as the footer template calls
Code:
vBulletin_init();
and that function needs to be ready to go or bad things will happen. There is a nice and fairly easy method available to put your javascript both on a diet, and make it fit into smaller pants all at the same time.


Enter: MINIFY
Minify is an awesome free library available at Google Code. In a nutshell, it offers us two main things.

  1. groups multiple files into a single call (saves DNS look ups, cookie attachments)
  2. minifies said content (saves file size)

I set it up on my forum and saw incredible gains.

The following tests were done via WebPagetest. It is a great tool that everyone should familiarize themselves with. The site is funded by Google, in case you were wondering. A good score here will almost guarantee better SERP results.

With the exception that I still run Apache, my server is highly optimized. I've spent many hours setting up gzip, cachers, and all the normal high performance goodies. I also spent a lot of time optimizing images, setting up my CDN, and other vB-centric enhancements. But, I kept failing on the 'Combine' grade point with no real solution available.

blogs/brian-cummiskey/attachments/8129-speedseo-make-your-site-fly-minify-before.png


After I installed Minify and got my forum to work with it, I was shocked by the results. The load time dropped by nearly 1.25 seconds and the biggest point in my opinion is the start render stat. From 1.7 to .9. That's basically TWICE as fast.

blogs/brian-cummiskey/attachments/8130-speedseo-make-your-site-fly-minify-after.png

I only got a 92, I know. But every remaining error is beyond my control. Most of them are from Adsense, Analytics, and items that SHOULDN'T be cached, but the script can't determine that on it's own.

So, I am going to put it out there and say that a vB forum running an adserver (openX in my case), Analytics, and Adsense (not in openX), a 92 is about as good as you are going to do in this test. There may be a 93 or 94 in it, but it is unlikely to ever happen.

The Long Way 'Round
To get here required a bit of a manual effort on my part. I probably could have coded a product to do most of this, and I may in the future, but for now, it is all pure template edits.

I'm not going to make this into a how-to for several reasons. Sorry if I got your hopes up. I performed this on vB3.8.1 and vB 3.8.5, both of which had many different scripts. The original plan to port/copy over what I did on 3.8.1 took me off guard and I basically had to start over. Who knows what happened in between. And now with 12 different versions of vB4 available, I'm sure a similar situation will exist. As this can have a drastic effect on your site to the point where either nothing loads or no one can post, I felt it best not to even begin to go down that road at this time. Plus, I haven't perfected it yet myself. There's actually a ton more things I plan to set up to run through the Minify engine including CSS. While I did port the CSS into it, I basically forced my self into being done editing my style, ever again. Well, not that strict, but I will need to re-hard code what I did all over again (as saving the css writes a new file name).

The point of this blog post was to point out that there is a tool available to get that last grade point up and increase your page load times dramatically.

In the future, I may be offering an integration product or service. But for now, this is where it ends. The tool is out there for you to use and play with and my results are proof positive that it does work. No, I won't give you the URL. If you know it, please don't post it. My side adventures are my personal projects and I like to keep my professional life away from the personal life.

I will be happy to entertain a discussion about the topic, but please do not expect code from me at this time.

Updated 02-09-2011 at 02:16 AM by Brian Cummiskey

Categories
Staff Blogs

Comments

  1. Brian Cummiskey's Avatar
    • |
    • permalink
    Call min via the cdn

    ie,

    http://cdn.domain.com/min/?files here
    Lindseycpopc likes this.

Trackbacks

Total Trackbacks 0
Trackback URL: