How to get WordPress to stop micro-managing your weblog

A word to the wise: WordPress (the software that manages all of the content you see herein) comes with a plugin (wp-cache) that’s activated by default. What this means is that the system does server-side caching of the site content, only giving you the latest version if you edit a post or if 3600 seconds (one hour!) elapse since the last time that page was refreshed. This probably works fine for individual posts, but it doesn’t work at all if you edit the theme/framework files… which aren’t tracked in the same way. (I spent a good deal of time this evening tweaking the site to add the sidebar content (at left) that shows the last few books I read, and I was mystified as to why my changes weren’t showing up.)

So here’s my solution:

Deactivate the caching while I’m editing, then turn it back on when I’m done. Because caching is good, since it helps the pages load faster for visitors like you, gentle reader. When it’s on, I have it set down to 5 minutes before the cache expires and it will reload the latest version. If you experience any problems with this, let me know in a comment.

3 Comments
2 of 2 people learned something from this entry.

  1. Iain said,

    February 13, 2007 at 10:24 pm

    (Learned something new!)

    That explains why I never see my edits update on the Salon.

    MediaWiki has a similar caching function, but it (correctly) checks the last modified date. The problem is that if you change the output from an extension, or you want to add some dynamic content to a wiki page, you need to disable the caching so that the page will be updated every time it is loaded.

    Hmm. Looks like WordPress is in php. Modifying it so that on an edit it clears the cache might not be too hard? Why has no one done it. Hmm.

  2. stough said,

    February 15, 2007 at 8:52 am

    (Learned something new!)

    Well, I guess that I learned something, but since I don’t blog or wiki…

    Anyhow, I think that you offended the WordPress Gods or Dreamhost screwed up because last night around 9:30, your page was only returning a WordPress error: “Can’t load database.” Do not taunt the WordPress. :)

  3. wkiri said,

    February 18, 2007 at 10:31 pm

    It’s not WordPress but the wp-cache plugin that needs updating, I think. And I don’t quite feel like poking around at it. I think their assumption was that, once the site is set up, the only dynamic content would be the posts themselves (which are properly handled and expired in the cache). They probably expect you to just pick a theme and use it as-is. Problems only arise when you go in and muck around with the inner workings yourself. :) It would be nice if the wp-cache folks documented this in their plugin.

    Also, the DB outage noted by “stough” was something Dreamhost did. Today they broke my mailserver for eight hours. Mistakes happen, I guess. (They did send me a nice apology.)

Post a Comment

I knew this already. I learned something new!