Fixes #5848 adds ability to turn off query cache