Speeding things up

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! ;)

My Netflix queue

After severely decimating my movie collection, I got to talking with one of the guys at work, and he gave Netflix a glowing recommendation.

It looks like a handy little service. You select what moves you’d like to rent, and then subscribe for a \$20/month fee. As movies become available, Netflix sends them to you. You watch them, then send them back. No per-day charges, no late fees — just send them back whenever you’re done. You’re allowed to have three out at a time, and when you send any back, more from your list get sent to you.

So, I figured what the heck, and signed up. ~~If anyone’s really morbidly curious, I’ll keep track of what’s in my queue here.~~ Feel free to suggest some, too!

Update: Trying to keep track of my rental queue was rapidly becoming fairly obnoxious to try to deal with as I kept adding stuff, so I’ve discontinued that. I’ve also moved my mini-reviews to posts of their own, rather than perpetually adding comments to this post. They’ll show up on the main page, or you can always check the MovieReviews category listing to catch up.

'Recent Tunes' update

Utilizing the iTunes Music Store linking hint I found earlier, I’ve updated the ‘Recent Tunes’ section of my sidebar. Before each artist, track, and album listing you’ll now see icons for Amazon and the iTunes Music Store — clicking on those will perform a search on the respective service for whichever line you clicked on. Nifty!

Some of the Amazon links are being a bit tweaky, and I’m not sure why, though. Sometimes they work fine, other times they get passed through with ‘"’ on either end of the search term, which confuses Amazon. I don’t know where that’s coming from, either — I can’t find that entity in any of the code on my side of things.

All the iTunes links work fine, however. The only caveat there is that they’re still building their selection, so the majority of my music probably isn’t listed yet. All good things in time, however.

Redesigning

Redesign in progress.

This is a starting point, not an end point. Some things may look goofy at the moment — my most humble apologies. Comments, as always, are welcome.

Yet to come: color (not one of my strongpoints, but I’m not planning on sticking with pure black and white for too long), some graphics to spruce the place up a bit, and, oh, whatever else that might fall out of my head along the way.

No more 404's

I just implemented a very nice little PHP script for my website that ties into my site search function — the end result being that my site no longer has a “404 File Not Found” error page!

In brief: if a visitor puts in a URL address that doesn’t exist, it gets shunted to my search script. If the script returns multiple hits, that listing is displayed, but if the script only returns one hit, the visitor is automatically forwarded to that page. Very slick.

As a bonus, it provides a convenient shortcut to searching my site — just put in whatever search terms you want after “http://www.djwudi.com/” and see what you get!

(script via Scriptygoddess)

Too…many…windows…

I’ve been told I need to stop posting so much information on my site, as the subsequent preponderance of tabs was threatening to take over one of my reader’s windows.

djwudi.com tabs

Not wanting to cause any undue stress to any of my five loyal readers, I should probably resolve that henceforth, I shall no longer blog about anything other than my pets, what I ate for lunch each day, and the annoying things that my co-workers did today.

Unfortunately, I don’t have pets, I tend to forget to eat lunch on a fairly regular basis, and now that I’ve moved to a new position at work, I’m not dealing with annoying co-workers on a regular basis.

So I’m afraid you’ll all just have to put up with the usual blather.

My humble apologies.

;)

A teense faster, I hope

In an effort to speed up the response time of my site when posting new articles, or when visitors leave comments, I’m experimenting with simplifying this page a bit. I think it’s working — things seem a teense snappier so far — but I’m still banging away at it.

Unfortunately, this means I’ve deleted the ‘Recently seen’ and ‘Recently read’ sections of my sidebar. Neither had been updated lately, so it may not be too big of a loss, but I’d still like to find a way to get them integrated back in later on if I can do so without impacting the server as much.

Geeky bits (and a question of written English usage) follow, if you’re interested.

I used to have the ‘Recent reads’ section (which listed books I was reading, along with reviews when I bothered) as a seperate blog, which I included in this page as an SSI.

(Quick unrelated question — when including acronyms in text, does one decide on using ‘a’ or ‘an’ before the acronym by the sound of the acronym, or by the sound of the meaning? Since ‘SSI’ is pronounced ‘ess ess aye’, that would call for using ‘an’, but when the meaning starts with the sibilant (Server), that would call for using ‘a’. Anyone know? I guessed and used ‘an’ on the assumption that most people would read the acronym rather than parsing the full meaning as they read, but I’m not sure if that’s correct or not. Anyway….)

The last time I redesigned The Long Letter, I incorporated the ‘Recently read’ blog into The Long Letter as a category, and added the ‘Recently seen’ category for my movie reviews. Then, in order to only display them in the sidebar and not in the main content area, I used a lot of ‘OR’ statements in my main content <MTEntries> tag, so it looked like <MTEntries category=“Books OR CSS OR DJing OR HTML OR Humor OR Internet OR Life OR Links OR Macintosh OR MovableType OR Movies OR Music OR PHP OR Politics OR Quotes OR Trek OR Website”>. The sidebar <MTEntries> tags were <MTEntries category=“BookReviews”> and <MTEntries category=“MovieReviews”>.

I’m thinking that this may have contributed to how long it took to rebuild when making changes, though. Anytime MT had to rebuild the front page — which it did both when adding new posts (obviously) and when a new comment was posted (in order to display the ‘Last 10 comments’ section of the sidebar) — it had to sort through and filter which posts were displayed according to what category they were assigned to.

So, for the moment, I’ve deleted the ‘Recently read’ and ‘Recently seen’ sidebar bits, and set the primary content area to a very simple <MTEntries>. Theoretically (in my brain, at least), this should speed things up.

As a last resort, I could take the ‘Last 10 comments’ section off, but I’d really hate to do that. It’s a really handy way for me to keep an eye on feedback on my posts, and a nice visual indicator that people are actually stopping by from time to time! So I’m hoping I don’t reach a point where I feel I have to lose that. Hopefully, simplifying the main content display will be enough to speed things up for now.

Useful bookmarklets

A ton of useful (and fun, in an extremely geeky sort of way) bookmarklets for digging into the code of a website to figure out just how it all works: Accessibility-checking favelets. I’ve snagged the first two listed already (‘Show and label divs with ids’ and ‘Show and label divs with classes’), and will be checking out more later on.

Geek toys!

(Via Zeldman)