[wp-trac] [WordPress Trac] #61343: Improve caching in get_calendar function

WordPress Trac noreply at wordpress.org
Sat Jun 1 21:50:35 UTC 2024


#61343: Improve caching in get_calendar function
--------------------------+-----------------------------
 Reporter:  spacedmonkey  |      Owner:  (none)
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Widgets       |    Version:
 Severity:  normal        |   Keywords:  good-first-bug
  Focuses:  performance   |
--------------------------+-----------------------------
 The `get_calendar` function is used to generate the calendar. There are a
 number of things that can be done to improve the performance of this
 function.

 - Replace the raw query to posts table with call to WP_Query query class.
 - Change cache invalidation from
 {{{#!php
 add_action( 'save_post', 'delete_get_calendar_cache' );
 add_action( 'delete_post', 'delete_get_calendar_cache' );
 }}}
 to
 {{{#!php
 add_action( 'clean_post_cache', 'delete_get_calendar_cache' );
 }}}
 - Instead of store all caches in a simple cache key, break them up and
 invalidate caches in another way.

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


More information about the wp-trac mailing list