Dougal Campbell: XCache Object Cache Plugin for WordPress 2.5+
144 Views Published 4 months, 1 week ago in Wordpress[drain file 16 show default_show]
This is another one of those articles that will be of interest to a minority of WordPress users. In particular, if you use the XCache PHP opcode cache and Neosmart’s XCache object-cache plugin for WordPress. For those of you who don’t know what the heck I’m babbling about, a PHP opcode cache is a bit of software which helps your web server do less work when turning all your PHP code into web pages that a browser can render. The object-cache plugin is a bit of code added to WordPress which communicates with a caching service in order to reduce the number of database queries it needs to make when building your pages. Together, this helps reduce the CPU load on your web server.
When WordPress 2.5 was released, it introduced some changes to the object cache API. Specifically, it introduced ‘global groups’ and ‘non-persistent groups’, which are just ways for WP to organize and optimize the data it stores in the cache. However, if you didn’t have an updated version of your object-cache.php plugin, you’d start to see some ‘quirks’ in your system. The things I noticed the most were that my comment moderation counts and plugin update counts would not update properly when I flagged comments or upgraded my plugins. I had hoped that Neosmart would update the plugin, but I never saw any news about it, so I ended up just disabling the object-cache on my site.
Then recently, I had to do some work on the memcached version of the object-cache plugin for a client. This inspired me to go ahead and take a look at the code myself, and update the XCache plugin. By looking at the changes to the memcached plugin, I was able to see that it really wasn’t very hard to make similar changes to the XCache plugin.
I’ve sent my changes to the author of the original plugin, but until any official update comes out, you’re welcome to download my changes.
NOTE: this is not a normal WordPress plugin, it does not go in your plugins directory! Install the ‘object-cache.php‘ file directly in your ‘wp-content‘ directory! You must also add the following line to your wp-config.php file, just before the comment that says ’stop editing’:
define('ENABLE_CACHE', 'yes');This no longer required in newer versions of WordPress.
For more information, see my previous article, Using the WordPress Object Cache.
UPDATE 2008-09-02: After seeing comments about people getting errors, I took a closer look and found a couple of typos. Version 0.7c should clear those up.
Tags: comments, database, plugin, release, server, Wordpress, wpSearch
About This Entry
- You’re currently reading “Dougal Campbell: XCache Object Cache Plugin for WordPress 2.5+,” an entry on The Staff Lounge
- Published at 9.2.08 / 4pm
Related Entries
- Weblog Tools Collection: WordPress Plugin Releases for 09/03 - Wordpress
- Andy Skelton: Upgrade Memcached Before WordPress - Wordpress
- Donncha: WP Super Cache 0.8 - Wordpress
Recent Entries
- vBulletin 3.7.5 skins… - Transverse Styles
- Matt: Open Sourcing Resolutions - Wordpress
- [Any Version] Quick Upgrade Checklist to Minimize Downtime when Upgrading vBulletin - vBulletin Quick Tips and CustomizationsvBulletin Tips
Popular Resources
- Phorum-5.2.9a released (6 replies) - 12925 Views
- Phorum-5.2.8 final released (13 replies) - 5892 Views
- Phorum-5.2.9 released! Security Upgrade! (1 reply) - 2938 Views







No Responses to “Dougal Campbell: XCache Object Cache Plugin for WordPress 2.5+”
Please Wait
Leave a Reply