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?

  • I'm confused about getting wp-admin faster. So how many posts do you have and How slow is your dashboard? Are there any additional plugins installed?
    – Baljka Gan
    Oct 22 at 15:37
  • I can see from Query Monitor exactly what's slow so I can see that at least some of my own codes are slow. I have already tried my best to make them quicker but now can't make them faster. They are quite big queries. So need to work with caching instead. But pre-caching so that no-one has to cache it themself by entering the page. Oct 23 at 16:20


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.