Having the extension calling the driver looks weird to me. IMO, the extension should be able to modify the query but the Cache should still be responsible to call the driver.
Currently, because of this responsibility shift, your extension (known by the Cache) has to know the Cache instance and the Cache has to expose its driver publicly.