move query cache API to AbstractQuery