Skip to main content

Faster...better...blog

I did a bit of work to improve the caching mechanism. Now, I keep the titles, comment counts, and tags in a separate cache file. That way, when I want to fill in the 'by date', 'latest posts', 'tags', and index pages (or portions thereof), I don't have to look through each entry each time to figure out what the title of the post is and the tags. The more work I do, the more I think of how this could be faster if all the data was stored in a database (precisely the reason against why I started this blogging software. However, I still want to keep this software database-free. So, small cache files improve the time greatly.

If I want to scale this software up to be more of like a 'Digg' style site, I would have to use a more aggressive caching mechanism. For example, each time a comment is made, the cache is flushed. If I could update the entry cache a bit more intelligently (i.e. update instead of regenerate), it would be a lot faster. However, there would be new race conditions, etc.

I'll do that later. Another project for another day.

I just hope I didn't break anything.