Make WordPress Core

Opened 16 months ago

Closed 15 months ago

Last modified 14 months ago

#57298 closed defect (bug) (fixed)

Remove placeholder from `WP_Term_Query` cache key

Reported by: spacedmonkey's profile spacedmonkey Owned by: spacedmonkey's profile spacedmonkey
Milestone: 6.2 Priority: normal
Severity: normal Version: 4.6
Component: Taxonomy Keywords: has-unit-tests has-patch needs-dev-note commit
Focuses: performance Cc:


Follow up from [54634].

Cache key generation doesn't work when using escape placeholder in WP_Term_Query. The fix from [54634] should also be applied to WP_Term_Query.

Change History (12)

#1 @spacedmonkey
16 months ago

  • Summary changed from Remove placeholder from WP_Term_Query to Remove placeholder from `WP_Term_Query` cache key

#2 @spacedmonkey
16 months ago

  • Focuses performance removed
  • Keywords needs-patch added

#3 @spacedmonkey
16 months ago

  • Focuses performance added

This ticket was mentioned in PR #3814 on WordPress/wordpress-develop by @spacedmonkey.

16 months ago

  • Keywords has-patch added; needs-patch removed

#5 @spacedmonkey
16 months ago

Has patch now, worth reviewing.

@spacedmonkey commented on PR #3814:

15 months ago

Unit tests added.

#7 @spacedmonkey
15 months ago

  • Keywords has-unit-tests needs-dev-note commit added

#8 @spacedmonkey
15 months ago

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

#9 @spacedmonkey
15 months ago

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

In 55083:

Taxonomy: Remove placeholder from WP_Term_Query cache key.

Remove escape placeholder from query cache key, as placeholders are on a based on a unique id on every request. This meant that it is impossible for a cache to be reused, making queries that use escape placeholders such as searches, meta queries or using the description__like / name__like parameters were unable to be cached.

Follow on from [54634].

Props spacedmonkey, peterwilsoncc.
Fixes #57298.

#11 @milana_cap
14 months ago

@spacedmonkey, do we have a volunteer to write the Dev note?

#12 @flixos90
14 months ago

Drafted a note for this to be included in the Field Guide's notes section, as shared in

Note: See TracTickets for help on using tickets.