A bit of a refresh!

As you’ll notice, the site has undergone a bit of a refresh. Content hasn’t changed much but my Twitter stream and Flickr Photostream take a front seat as these are the places where I am most active.

I’ll also be attempting yet again to keep blogging. My blog will be very tech focussed and will more often than not highlight tech issues and solutions that I come up against in my work. It will be pretty random, more of a repository of gotchas for myself and anyone else who happens to be doing similar stuff.

Getting WP-Super-Cache to work with WordPress on Nginx

I was setting up WP-Super-Cache yesterday when I ran into this gotcha, I’ve done this before so I should have known better, I’m blogging it now so that I don’t forget and anyone else with this issue can be saved some hassle.

Essentially WP-Super-Cache was only half on, it could generate wp-cache files but was not creating static cache files.  The reason for this was that the querystring always contained at least one value even though it wasn’t in my URLs. That drove me crazy until I remembered this morning that the recommended Nginx setup was the problem the last time. The reason for this is the following part of the Nginx config that rewrites any non existing file requests to WordPress’ index.php

if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;

This will cause WP-Super-Cache to never generate any static cache files since one of its conditions for doing so is that the querystring is empty.
If your Nginx config has this, try changing removing the ?q=$1 as below:

if (!-e $request_filename) {
rewrite ^(.+)$ /index.php last;