Adds cache invalidation when branch following changes