WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#9580 closed defect (bug) (invalid)

wrong cache key?

Reported by: Denis-de-Bernardy Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Optimization Keywords: dev-feedback
Focuses: Cc:

Description

in function &get_pages(), the cache key is defined as:

$key = md5( serialize( compact(array_keys($defaults)) ) );

Shouldn't this be:

$key = md5( serialize( compact(array_keys($r)) ) );

?

Change History (3)

comment:1 @Denis-de-Bernardy6 years ago

#8683 is possibly related.

comment:2 @Denis-de-Bernardy6 years ago

  • Component changed from General to Optimization
  • Keywords dev-feedback added
  • Milestone changed from Unassigned to 2.8
  • Version set to 2.8

comment:3 @ryan6 years ago

  • Milestone 2.8 deleted
  • Resolution set to invalid
  • Status changed from new to closed

$defaults is used on purpose because $r can contain arguments that apply only to the calling function. wp_list_pages(), for example, passes its whole args array to get_pages(). If we include the callers args in the key we will have cache misses for queries that are the same.

Note: See TracTickets for help on using tickets.