Adds cache invalidation on class.update_counters and reset_counters