Cache SQL query too.