When enabling/disabling query cache, make sure we are connected first