Opened 4 years ago

Closed 4 years ago

#9580 closed defect (bug) (invalid)

wrong cache key?

Reported by: Denis-de-Bernardy Owned by: anonymous
Priority: normal Milestone:
Component: Optimization Version: 2.8
Severity: normal Keywords: dev-feedback
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)

#8683 is possibly related.

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

comment:3   ryan4 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.