Generating Static Webpages
Thursday, September 23rd, 2004I have been asked to rewrite The Sheet Music Companyfor Stephanie’s cousin. I originally wrote this site a couple of years ago, and I think the old way is so much better than the new way I will have to write it.
The original design of the site is odd, but straight-forward. The site uses a eCommerce package from Americart that handles all of it’s inventory, order processing, etc. The pages that Americart generates are terrible looking, so I wrote a wrapper script around them. When you view a page, the script requests the page from Americart, parses out the useful information, and then generates the new html. Odd, but works beautifully.
Well, the site owner has gotten it into his head that search engines hate dynamic pages. Since I don’t really know or care much about search engine optimization, I have decided not to argue the point too much. So, he wants the site to consist of all static html pages. Since the inventory is updated frequently, this makes for an interesting proposal.
So, that brings me to the new design. First, the owner will upload the inventory DB to the site, and it will be imported into mySQL. Next, a script runs that takes his inventory DB and a couple of config files, and generates thousands of static partnumber.html pages. This strikes me as an altoghter odd way of designing a website, but it is the best I have been able to come up with. I got the idea from Climbing Boulder which also works in a similar way.
There are a lot of benefits to this design. First, there are no DB queries or scripts that have to run to view the pages. This should make the site extremely fast. Second, theoretically, search engines will like the static pages more.
There are also some problems with this design. First, it works best with a site that has minimal change on it. A blog site with a dozen posts and thousands of comments posted a day (www.slashdot.org) would not be the best choice for this design. Second, it seems like a fragile design were a malformed inventory line could prevent a large section of the site from being generated.
In the end, I have very mixed feelings about this design. It addresses the owners concerns, but I don’t feel that it is an elegent design. Why have 3,000 pages that are essentially the same, when you could have but a single page and reference the DB to fill in the details. So, this will increase the number of pages for the site from a dozen to several thousands. The flip side is that now, instead of a constant stream of DB requests I now make a large block of DB requests in the middle of the night while usage is low. We will see how this works out.