Comment posting is a bit faster now.

You may have noticed it doesn’t take as long for a comment to post in the last couple of days. I read something about MT and the speed of rebuilding pages at another site (don’t recall where) and in the comments there Ben Trott (one of MT’s programmers) mentioned that the slowdown seems to be a result of using the MTArchive tag a bit too much.

Well, I use it a lot and not just on some of the archive pages. For example, many of the things in the navbar to the left, such as the listing of links to the monthly and category archives, make use of the MTArchive tag to create them. That side bar is on the main index page as well as the individual entry pages and the category archive pages as well. I was originally including it using MT’s built-in template module system and that means that every time a comment was posted or an entry was added it was processing those MTArchive tags a minimum of 5 times for every page that needs to be updated.

The solution? I created a new “index” template that contained the code for only the sidebar and then import that into the various other templates using PHP’s include statement. Now those tags are processed once for all the sidebars instead of repeatedly for each page that uses them. The other advantage is that the sidebar is now consistent across all pages (it used to do different things depending on the nature of the page it was being used on). Honestly, I don’t know why this didn’t occur to me sooner as in hindsight it makes perfect sense. SEB is still no speed-demon, but it’s definitely faster than it was.

3 thoughts on “Comment posting is a bit faster now.

  1. Alice is spamming for First Europa, which is a Dutch insurance company.

    Cringely’s PBS blog also got hit, as did devzone.zend.com, thinksecret.com, theequitykicker.com, and many others.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.