[wp-trac] [WordPress Trac] #63945: Make cache in wp_count_posts

WordPress Trac noreply at wordpress.org
Mon Sep 8 11:33:06 UTC 2025


#63945: Make cache in wp_count_posts
----------------------------+----------------------------
 Reporter:  spacedmonkey    |      Owner:  (none)
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Future Release
Component:  Administration  |    Version:  2.5
 Severity:  normal          |   Keywords:
  Focuses:  performance     |
----------------------------+----------------------------
 Current there is a cache in wp_count_posts function. See

 {{{#!php
         $cache_key = _count_posts_cache_key( $type, $perm );

         $counts = wp_cache_get( $cache_key, 'counts' );

 }}}

 As this use the `counts` cache group, this cache does not persistent
 between page requests. However the SQL query that is run in this function,
 can take a long time and can result in the admin list page to render
 slowly. This cache should be made to persistent.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63945>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list