add a constant/method cache invalidation callback