Cache queries, if cache() is available.