Here's a little library i've used in different forms on a few different projects. It can cause some pretty heavy hitting of the memcache endpoint so you may want to use another peristance layer for tracking key versions but it does a great job of giving you an semi easy to to manage cache invalidation with a high granularity. Enjoy and I appreciate any feedback you have.