Now With More Sidebar!

Posted on 10 July 2005 by jose

I've done Yet Another Site Re-design. I've added a sidebar for easier entry navigation, which played around with the way CSS floats behaved in Firefox and IE. I believe I've got most of those bugs ironed out, but now the archive navigation needs a re-write. Right now, the code is pretty messy; I'd like to go through and refactor it all. I'm tempted to completely re-write it, as the sidebar adds an interesting wrinkle: right now, the sidebar is generated from the id and subject line of the latest 10 entries. But I'd like to see if I can reduce the number of times MySQL is accessed. I essentially have to optimize the MySQL query to return the right number of results once and generate the entries and sidebar from the result set. I've got to balance that against the archive, where the result set may be smaller or larger than the number of entries I'd like in the sidebar. A side effect of the sidebar is that the site is close to being RSS-ready; the sidebar contains exactly the information necessary for RSS. However, I'm going to concentrate on debugging the new site design and the issues it causes in the archive navigation before starting to implement RSS.

I'm also considering creating a persistent result set for searching the archive. If someone wants every entry between this and that date, and that search comprises more entries than would be comfortably displayed, I can either page through a persistent result set for that search or run the search again for every page and advance by a defined offset (i.e., 10 results per page, a la Google). I'm fairly certain Google doesn't run the same query again and again per page, though. It's probably easier to do a result set per session and grab the first x pages of the result set. If the user actually wants, say, page 6 or higher, it clears the session and runs the search again then, with the appropriate offset. That way it gets fewer hits to its database, making it faster, and avoids creating (and deleting) really large result sets when most users aren't going to go much farther than page 3 or 4 on a search.

Latest poll

Which do you favor?