use cache_query to cache query