User-defined storage handler are the way to lift most limitations of the query cache plugin for mysqlnd. For example, you can break out TTL invalidation and put any other more complex invalidation in place. You may go as far as preventing stale results from being saved. Learn how!