Add a test which enables caching and debug queries and make sure the debug query does not overwrite the cache.