I stumbled back on this post whilst Googling searching for how to clear APC. Thanks for the handy snippet! I spent a few hours trying to debug something this morning until realising it was the damed object cache causing the problems after a fresh database dump.

One change I might make if I get time, is to do the authentication via a form instead of the URL. It’d be slightly more secure that way. It’s a minor issue though since the worst case scenario is that someone can clear your cache.