Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#34205 closed enhancement (fixed)

Add a filter to short-circuit get_lastpostmodified()

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

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
11 years ago

  • Owner set to pento
  • Status new → assigned

#2 @pento
11 years ago

  • Resolution → fixed
  • Status assigned → 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.