Added config and switch to control using cache