Beefing Up Self-Hosted Wordpress with Google AppEngine
Well it’s 2010, and I definitely had a distractable end to 2009 (with a distinct lack of blogging). So to kick off 2010, I thought I’d start trying to get a few of the “low hanging fruit” ideas that I’ve had over the last six months written and working.
The first of those will be an experiment using Google’s AppEngine as a front-end proxy to a less robust website, hosted on low-cost hosting. Whilst not sure, I’ve got a feeling that I’ll be able to give my self-hosted wordpress blog a layer of resilience with some app-engine mem-caching goodness.
The basic principle behind the idea is to implement a simple site proxy on Google AppEngine and make use of AppEngine’s memcache to provide relief to the rather cheap shared hosting that I currently run this blog on. In this way, should I ever write an extremely compelling post then my blog won’t get smashed by the SlashDot / Digg effect. The diagram below illustrates in very simple terms the relationship between the sites.

So, basically:
- The AppEngine application passes through all GET request through to the parent site, storing a copy of the page in memcache before serving the content back. If the specific url was already memcached then that it is returned from the AppEngine site without a round-trip to the parent server.
- POST requests are result in a cache-clear for the url, then the round-trip to the parent server. Then the request is handled in the same manner as a GET request.
- I’m thinking a plugin for the wordpress site is required, so that when I approve comments using the administration facility (I don’t think this should go through the AppEngine application) the WordPress site can instruct the front-end to clear the cache.
That’s the concept in a nutshell, and as pointed out by Glen Maddern when I mentioned I was thinking about this on Twitter, the same application should be able to act as a front-end layer for sites other than just WordPress Blogs. Static sites would just work. Web applications are likely to be more problematic, which is good, as I’m really not in the business of creating tools to stand up a phishing site easily.
In terms of my own personal setup, I plan to www.distractable.net to the AppEngine application, and leave distractable.net pointing at the shared hosting. I’d probably go the other way around if AppEngine supported naked domains, but it doesn’t.
Would really appreciate any feedback on this idea, including those nice curly situations that are likely to make the whole thing fall in a heap
I’ll make sure I update the post with progress updates on how the coding is going – hopefully, if I can keep the blinkers on, then it should be done in a week or so. The source will be kept at GitHub, so feel free to watch the repo if you like to keep up-to-date that way.
UPDATE 11/01/2010:
Looks like there is already a project that is attempting to use AppEngine in a similar way, but as a downstream proxy for browsing. I am unfortunately not fluent in the native tongue of the maintainer of the project, but if you would like to take a look here is a link to the project:
