CC-5555 : Implement simple caching for preferences

better to include the key in the error message