Smart invalidation