I have a wordpress one-page website that shows a table of posts (about 30-40).
Each row in a table contains details about a post, and 5 columns of 6 “statuses” (a custom post type) that are linked to the post.
Each status itself shows all “messages” (another custom post type) that are linked to the status.
So in total, I have to make 1 query for the posts, then 40 queries to get the “statuses” for each post, then 6*40 queries to get all messages for each status/
This results in a pretty high load time (about 5 sec), and this is with only one user accessing.
I am trying to find if there is anyway to do this smarter with less queries, assuming that “messages” can change every several minutes so I don’t know how much caching is an option.