Make WordPress Core

Opened 2 months ago

Last modified 5 weeks ago

#61343 new enhancement

Improve caching in get_calendar function

Reported by: spacedmonkey's profile spacedmonkey Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Widgets Keywords: good-first-bug has-patch
Focuses: performance Cc:

Description

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
    add_action( 'save_post', 'delete_get_calendar_cache' );
    add_action( 'delete_post', 'delete_get_calendar_cache' );
    

to

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.

Change History (5)

This ticket was mentioned in PR #6708 on WordPress/wordpress-develop by @narenin.


2 months ago
#1

  • Keywords has-patch added

#2 @narenin
2 months ago

Hi @spacedmonkey

I have suggested the PR with fix.

@narenin commented on PR #6708:


8 weeks ago
#3

@mukeshpanchal27 Could you please take a look.

@narenin commented on PR #6708:


6 weeks ago
#4

@spacedmonkey Could you please review this PR.

This ticket was mentioned in Slack in #core-performance by mukeshpanchal27. View the logs.


5 weeks ago

Note: See TracTickets for help on using tickets.