cache queries by principal id