Invalidating cache if the definition is out of date with the latest version of K.

@dwightguth please review.