I’ve been a huge fan of Redis since the first time we met at the 2011 Keeping it Realtime conference in Portland.
The idea of a typed, in-memory database was hugely appealing. I was still working at a Windows shop at the time, so I took a bit of time to make sure I could compile Redis to run on Windows in order to use it with IIS and my .Net apps.
Conveniently, I wasn’t the only Windows developer working on this, and these is now a cool installer for the platform.
Fast forward a couple of years and I’m working full-time on WordPress.
I had difficulties with Memcached
Like Redis, Memcached didn’t used to play well with Windows. It took me a while to learn how to use it and, until a sysadmin friend of mine helped me wrap my head around it, I’d never been able to get Memcached working on Linux until a few months ago.
Mock me for having trouble with it – I really don’t care. Memcached was difficult to learn, so I never used it until recently.
Which also means most of my WordPress sites lacked true caching until recently. Now, they all use Batcache with a Memcached back-end for page caching and Memcached itself for object caching.
The performance gains have been huge!
I value simplicity
On one of my servers, though, I’m already running Redis to power the data layer of a few realtime Node applications. Installing a second in-memory data application seemed like overkill to me; I wanted to keep the server environment as simple as possible.
Rather than settle with Memcached (and duplicating the applications on the server), I took some time to investigate Redis-powered page caching on the server.
I wanted to take things a bit further. I had a hacked-together solution for page caching, but still lacked a meaningful object cache for my server.
Redis Object Cache
After a few weeks, I got tired of waiting for someone else to build one – I sat down in a Quiznos across from a WordPress meetup and wrote a hasty 0.1 version of a Redis object cache.
It was buggy, incomplete, and heavily derivative of a friend’s Memcached object cache. But it worked!
Erick Hitter joined the project shortly thereafter and helped polish things up a bit. We now have a fully-functional 1.0 release of the Redis Object Cache for WordPress!
Next Steps
Right now, the plugin bundles the Predis library to allow PHP to interact with Redis. I much prefer depending on the Pecl extension for Redis and, in a next version, will likely make this a hard requirement.
I also want to take the time to retrofit testing into the project.
The biggest next step, however, is to get people like you to give the new caching layer a spin.
If you’ve already got Memcached set up, I don’t want you to switch. Memcached is perfectly capable of satisfying your caching needs.
If you’ve got Redis installed already, or if you’re lacking any form of in-memory caching, then you should take the system through its paces. I’ve open-sourced it on GitHub, so feel free to submit your successes or challenges there. Or pull requests, if you have improvements to make.