When enabling/disabling query cache, make sure we are connected first
Merge pull request #188 from nickmarden/new-cache-middleware

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