Cache results returned from the database.