Add an optional second parameter to cache, used to conditionaly enable/disable caching