implemented cache for env rule