Speeding things up
MovableType May 14th, 2003 |If all has gone well, I should have just sped up my site when processing new comments or trackback pings, thanks to Sean Willson’s mt rebuild type modification.
Technical details follow (Kirsten, you’ll want to look at this one…)
(via Phil) By default, MT rebuilds all index templates whenever an entry is created or edited, or when a comment is added. This is done to keep everything as up to date as possible, and is as it should be.
However, as a site grows, and as more bells and whistles are added to it, the time it takes to rebuild all those templates keeps growing. The usual set of index templates includes the main index page, the RSS feed, the main archives index page, the CSS stylesheet, plus whatever archive pages may be set up — all this has to be rebuilt, along with the page for an individual entry, whenever anything changes on a site.
I’d already done what I could to speed up my rebuild by setting my stylesheets to only rebuild when I specifically tell them to (as they normally don’t change), but I’d also added a few more index templates to the mix (the excerpts for my main table of contents page and a secondary RSS feed). All of this was what has caused my server to run so godawfully slow whenever comments or trackback pings are received.
Sean’s modification changes the way MT’s rebuild system works, though. While by default, MT only allows you to set whether a particular template is an index template (and therefore needs to be rebuilt regularly) or not, with this modification in place, there is much finer control over which templates are rebuilt under what circumstances.
So now, my table of contents excerpts, master archive list, and RSS feeds will only rebuild when I add or edit an entry. The main index file will rebuild whenever entries are added or edited, or when new comments are received. Additionally, individual entry pages should rebuild when trackback pings are received automatically, instead of my having to rebuild them manually (which is what I’ve been doing).
Kirsten — the reason I wanted you to peek in on this one is that as this is a modification to the MT system itself, and not just my weblog, you may need to go into your templates and set the rebuild options for each one. Everything may work normally if you don’t, but I’m not entirely sure how it will work if those fields haven’t been set, and you try to add an entry. The changes should be fairly obvious (you’ll need to go into the edit screen for each template, and choose the right option from the new drop-down menu), but if you need any help, feel free to e-mail me or IM me if it’s late enough. Hopefully this doesn’t leave you grumbling at me!
[See also: Transitioned | Destinations | Trackback changes and Category links | MT upgrades | Yet More Tweaks ]
« It’s real! No, it’s a hoax! Wait… | My Big Fat Greek Wedding »
9 Responses to “Speeding things up”
Leave a Reply






May 14th, 2003 at 10:40 pm
This is actually just a quick test comment to see if I can spot any actual speed increase (crossing my fingers here)…
May 14th, 2003 at 10:47 pm
Let’s see how this works, shall we?
May 14th, 2003 at 10:51 pm
Since it sets the default of “entry, comment” on everything at first, it should only be a problem with TrackBack counts not incrementing (and the TrackBacks themselves not showing, if they’re shown somewhere other than just the popup).
May 14th, 2003 at 10:54 pm
Cool, good to know, Phil — I’d noticed that just after installing the patch, the fields for ‘Rebuild Type’ were blank in the overview, and when I went into the template, the first option on the list (and therefore the one that shows immediately) was ‘never’, hence my slight confusion.
May 15th, 2003 at 9:55 am
okie i did it the same way as you, but i might try out changing to ‘all’ for the index and ‘entry comment’ for the archive…
because i like them.
May 15th, 2003 at 10:11 am
(laughs) Do whatever you like! I just wanted to make sure you knew about the change, and that things didn’t start to go all wonky. I haven’t noticed any speed problems on your site, so this was pretty much entirely for my benefit, since I like playing with all these toys.
May 15th, 2003 at 11:20 am
Very interesting. I may have to get this implemented tonight. As you know, comment posting takes forever on my site!
September 29th, 2003 at 10:46 pm
I saw this and just wanted to let you know that if you set “link this template to a file” to site-styles.css (or whatever your css file’s name is), you never have to run an MT rebuild on it because it will automatically sinc with the “hard copy” (site-styles), and therefore automatically update your site.
September 29th, 2003 at 10:48 pm
P.S. Unless, of course, you have MT tags in your CSS file. Which I doubt.