Added config flag for caching.