« Complete Incompetence | Pearl Jam Vancouver 2005 »
 New Navigation Bar Implementation - Nullstream Site
Posted by J on September 10, 2005 12:34 AM PST

At the behest of my co-authors, I've re-implemented the navigation bar that appears on every page of the site. Please comment on this entry if you were bothered by the posting speed in the past, and you notice any change (or no change). Theoretically it should speed things up...

The original mechanism used MovableType's server side 'build time' includes to dynamically insert the comment, category and date listings into the side of each page. This is better than actual server side includes, which will dynamically build the page on each request - instead, MT builds the page only when items in the relevant category, comment, etc. change. This produces a html file rather than an asp or php file.

What we were finding was that page loads were fast, but comment and new entry posts were getting very slow. This is partially becuase our host is somehow throttling our CPU usage on page rebuilds. Then again, our cpu on page rebuilds is growing because each comment post causes ALL pages on the site to be rebuilt (well, not quite... see additional benefit, below).

The new mechanism farms this work out to your CPU! All the dynamically build content in the navigation area is now contained within a single file. Comment or entry posts simply cause this file to rebuilt, rather than all the pages that used to have the navigation bar inline. Each of these pages now dynamically includes this common navigation bar page.

There were three basic options for making a single copy of the navigation information: JavaScript includes, iFrames, and server side includes.

The main drawback to the JavaScript method is that it requires JavaScript to be enabled (and implemented) on the browser. It also sucks a little more of your CPU and requires a seperate HTTP connection to download the JavaScript file. If HTML would have just supported an <html src="insertMyFileHere.html"> just like it does with an image tag, this javascript hack wouldn't be necessary.

Oh, the side benefit is that ALL archived pages now have the most up to date recent comments and recent posts listed. For some reason, MovableType was not consistently updating all archived pages when these changed in the past.


 Comments (2)
John, September 13, 2005 01:04 PM:

J, as always.. you're the man!

J, September 17, 2005 12:06 PM:

I realized since all the navigation bars are now via JavaScript, Google will have to go really deep to index all the pages on the site. It won't have any way to get to the Monthly or Category pages, but it can find a path through each individual entry by following the "previous entry" link on every post. Not sure it follows single URL chains back for hundreds of posts, however. I'm going to return the front page only to having a fixed sidebar so that google can access all of our content directly. This will also allow users with JavaScript disabled to navigate the site. Notice how I just use "Google" to represent "The search engine". It's the new Xerox.


 Post a comment:





All links will be marked with the nofollow tag, making them useless for search rankings. Any posts containing spam URLs will then be deleted.

« Complete Incompetence | Pearl Jam Vancouver 2005 »
Copyright © 2004-2007 Nullstream Group.