Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#9580 closed defect (bug) (invalid)

wrong cache key?

Reported by: denis-de-bernardy's profile 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)

#1 @Denis-de-Bernardy
15 years ago

#8683 is possibly related.

#2 @Denis-de-Bernardy
15 years ago

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

#3 @ryan
15 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.