Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#34205 closed enhancement (fixed)

Add a filter to short-circuit get_lastpostmodified()

Reported by: pento's profile pento Owned by: pento's profile pento
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords:
Focuses: performance Cc:

Description

When the result of get_lastpostmodified() changes, this can cause a cache stampede on high traffic sites.

This is particularly problematic when the query is slow. See #15499.

Change History (2)

#1 @pento
9 years ago

  • Owner set to pento
  • Status changed from new to assigned

#2 @pento
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 34935:

Posts: Add the pre_get_lastpostmodified filter to get_lastpostmodified().

This allows get_lastpostmodified() to be short circuited when the site wants to avoid running the occasionally slow queries in _get_last_post_time().

Fixes #34205.

Note: See TracTickets for help on using tickets.