Cleanup cache invalidation routine