Resetting the Wordpress Object Cache

So I was trying to move my friend Conner’s blog to a new domain and having a bit of trouble. I’d just upgraded him to Wordpress 2.0 and I had him login, change the Site URL and Home variables to point the the new URL for the blog, and then move the physical blog folder on disk over to the new directory (this was all on the same server).

It didn’t work, we were unable to login, because Wordpress kept redirecting us to the wp-admin page for the old blog URL. I went into the database to check the values of the siteurl and home options, and they were both the correct (new) values. And yet wp_get_settings() was still returning the wrong (old) value for these variables.

I could not for the life of my figure out why until I looked at the source code for wp_get_settings() and saw something about caching. Turns out one of Wordpress 2.0’s great new features is Persistent Object Caching which means pages and options can be cached on disk, so when they are served up the server doesn’t have to check their value in the database. This is all great if the cache is correctly updated when these options are changed, but for some reason, it wasn’t in this case.

I found out that the solution was to remove the wp-content/cache directory and let Wordpress rebuild it.

Whew.


One Response to “Resetting the Wordpress Object Cache”  

  1. 1 hypotheek

    Hi, My name is Suzanne from France. 16 years of age. I like this too! I am a student, doing research on the recent ‘bloghype’ I hope you do not mind me using it coming thursday when I have to finish my project. It would be nice to show my teachers I learned something here. Thanks. :-)

Leave a Reply