I'm working on getting my wp-admin faster and is thinking about how I can get those slow get_posts() with a lot of meta queries faster.
I have already made som progress with replacing a lof of LEFT JOINs with pivot tables instead. However it's still a bit too slow. I'm looking into turning on presistent object caching with Redis for wp-admin. But it needs to be configured the right way then so that data is updated.
Rather than waiting for the cache to be cleared or be cleared on save. I would rather want the cache to be updated on save. I don't mind the save process to take a bit longer if it updates the cache at the same time. But is there a system that can do this?
I'm thinking there should be like a between-database-and-site cached "table" that holds the main posts for a specific get_posts. Say that table has been cached by just running a query for post type and collecting some meta data. Then I could be able to use this cached table in array form and filter it out for pagination and other meta queries. Does WordPress has functions for this?
I want it to never ever set a cache when a person is entering the page. All cache should be set on save of posts or by the crawler.
Am I crazy that wants it this way? What is the best practice here?