Make WordPress Core

Opened 2 years ago

Closed 23 months ago

Last modified 22 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:

Description

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

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

#2 @spacedmonkey
2 years ago

  • Focuses performance removed
  • Keywords needs-patch added

#3 @spacedmonkey
2 years ago

  • Focuses performance added

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


2 years ago
#4

  • Keywords has-patch added; needs-patch removed

#5 @spacedmonkey
2 years ago

Has patch now, worth reviewing.

@spacedmonkey commented on PR #3814:


23 months ago
#6

Unit tests added.

#7 @spacedmonkey
23 months ago

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

#8 @spacedmonkey
23 months ago

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

#9 @spacedmonkey
23 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
22 months ago

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

#12 @flixos90
22 months ago

Drafted a note for this to be included in the Field Guide's notes section, as shared in https://wordpress.slack.com/archives/C02KGN5K076/p1677531978930639?thread_ts=1677512400.171959&cid=C02KGN5K076.

Note: See TracTickets for help on using tickets.